mlp¶
MLP
& its config.
- class cneuromax.fitting.deeplearning.litmodule.nnmodule.mlp.MLPConfig(dims='???', p_dropout=0.0)[source]¶
Bases:
object
Holds
MLP
config values.
- class cneuromax.fitting.deeplearning.litmodule.nnmodule.mlp.MLP(config, activation_fn)[source]¶
Bases:
Module
Multi-layer perceptron (MLP).
Allows for a variable number of layers, activation functions, and dropout probability.
- Parameters:
activation_fn (
Module
) – The singular activation function to use in between each layer.
- model¶
The internal
torch.nn.Module
that holds the MLP’s layers.- Type:
- forward(x)[source]¶
Flattens input’s dimensions and passes it through the model.
Note
This MLP is currently only capable of returning 1D
torch.Tensor
batches.TODO: Add support for returning 2D+
torch.Tensor
batches.- Parameters:
x (
Float[Tensor, 'batch_size *d_input']
) – The input data batch.- Return type:
Float[Tensor, 'batch_size output_size']
- Returns:
The output batch.