This class is a PyTorch Model implementing the MLP model for 1-D or 2-D state values. More...
Public Member Functions | |
def | __init__ (self, int sequence_length, List[int] hidden_sizes, int num_actions, Activation activation=pytorch.nn.ReLU(), float dropout=0.5) |
Initialize Mlp model. More... | |
pytorch.Tensor | forward (self, pytorch.Tensor x) |
The forwards method of the nn.Module. More... | |
Data Fields | |
final_head | |
The final head to produce logits for given action. More... | |
flatten | |
The object to flatten the output fo feature extractor. More... | |
mlp_feature_extractor | |
The feature extractor instance of rlpack.models._mlp_feature_extractor._MlpFeatureExtractor. More... | |
This class is a PyTorch Model implementing the MLP model for 1-D or 2-D state values.
def rlpack.models.mlp.Mlp.__init__ | ( | self, | |
int | sequence_length, | ||
List[int] | hidden_sizes, | ||
int | num_actions, | ||
Activation | activation = pytorch.nn.ReLU() , |
||
float | dropout = 0.5 |
||
) |
Initialize Mlp model.
sequence_length | int: The sequence length of the expected tensor. |
hidden_sizes | List[int]: The list of hidden sizes for each layer. |
num_actions | int: The number of actions for the environment. |
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.Mlp.forward | ( | self, | |
pytorch.Tensor | x | ||
) |
The forwards method of the nn.Module.
x | pytorch.Tensor: The model input. |
rlpack.models.mlp.Mlp.final_head |
The final head to produce logits for given action.
rlpack.models.mlp.Mlp.flatten |
The object to flatten the output fo feature extractor.
rlpack.models.mlp.Mlp.mlp_feature_extractor |
The feature extractor instance of rlpack.models._mlp_feature_extractor._MlpFeatureExtractor.