Module Contents

class flambe.nn.mlp.MLPEncoder(input_size: int, output_size: int, n_layers: int = 1, dropout: float = 0.0, output_activation: Optional[nn.Module] = None, hidden_size: Optional[int] = None, hidden_activation: Optional[nn.Module] = None)[source]

Bases: flambe.nn.module.Module

Implements a multi layer feed forward network.

This module can be used to create output layers, or more complex multi-layer feed forward networks.


the sequence of layers and activations

forward(self, data: torch.Tensor)[source]

Performs a forward pass through the network.

Parameters:data (torch.Tensor) – input to the model of shape (batch_size, input_size)
Returns:output – output of the model of shape (batch_size, output_size)
Return type:torch.Tensor