mlp¶
MLP & its config.
- class cneuromax.fitting.deeplearning.litmodule.nnmodule.mlp.MLPConfig(dims='???', p_dropout=0.0)[source]¶
Bases:
objectHolds
MLPconfig values.
- class cneuromax.fitting.deeplearning.litmodule.nnmodule.mlp.MLP(config, activation_fn)[source]¶
Bases:
ModuleMulti-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.Modulethat 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.Tensorbatches.TODO: Add support for returning 2D+
torch.Tensorbatches.- Parameters:
x (
Float[Tensor, 'batch_size *d_input']) – The input data batch.- Return type:
Float[Tensor, 'batch_size output_size']- Returns:
The output batch.