This class is a PyTorch Model implementing the MLP based feature extractor for 1-D or 2-D state values. More...
Inheritance diagram for rlpack.models._mlp_feature_extractor._MlpFeatureExtractor:
Collaboration diagram for rlpack.models._mlp_feature_extractor._MlpFeatureExtractor:Public Member Functions | |
| def | __init__ (self, int sequence_length, List[int] hidden_sizes, Activation activation=pytorch.nn.ReLU(), float dropout=0.5) |
| Initialize MlpFeatureExtractor model. More... | |
| pytorch.Tensor | forward (self, pytorch.Tensor x) |
| The forwards method of the nn.Module. More... | |
Data Fields | |
| activation | |
| The input activation function. More... | |
| dropout | |
| The input dropout probability. More... | |
| hidden_sizes | |
| The input hidden sizes for each layer. More... | |
| linear_module_dict | |
| The ModuleDict of Linear Layers. More... | |
| num_blocks | |
| The number of layers/blocks of MLP. More... | |
| sequence_length | |
| The input sequence length of expected tensor. More... | |
This class is a PyTorch Model implementing the MLP based feature extractor for 1-D or 2-D state values.
| def rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.__init__ | ( | self, | |
| int | sequence_length, | ||
| List[int] | hidden_sizes, | ||
| Activation | activation = pytorch.nn.ReLU(), |
||
| float | dropout = 0.5 |
||
| ) |
Initialize MlpFeatureExtractor model.
| sequence_length | int: The sequence length of the expected tensor. |
| hidden_sizes | List[int]: The list of hidden sizes for each layer. |
| activation | Activation: The activation function class for the model. Must be an initialized activation object from PyTorch's nn (torch.nn) module. |
| dropout | float: The dropout to be used in the final Linear (FC) layer. |
| pytorch.Tensor rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.forward | ( | self, | |
| pytorch.Tensor | x | ||
| ) |
The forwards method of the nn.Module.
| x | pytorch.Tensor: The model input. |
| rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.activation |
The input activation function.
| rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.dropout |
The input dropout probability.
| rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.hidden_sizes |
The input hidden sizes for each layer.
| rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.linear_module_dict |
The ModuleDict of Linear Layers.
| rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.num_blocks |
The number of layers/blocks of MLP.
| rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.sequence_length |
The input sequence length of expected tensor.