sakura.models.modules.FCPreEncoder
- class sakura.models.modules.FCPreEncoder(input_dim: int, output_dim: int, hidden_neurons=None, hidden_layers=2, dropout=False, dropout_input=False, dropout_input_p=0.5, dropout_hidden=False, dropout_hidden_p=0.5, config=None)
Bases:
ModuleFully connected pre-encoder module class
Module supports configurable hidden layers and neurons, as well as dropout regularization.
- Architecture details:
When config is None, default 2 hidden layers with structure: Input → Linear → CELU → Linear → CELU → Output
Hidden layer neurons can be uniform (single neuron count) or varied (list)
Optional dropout placement after the input layer
Optional but uniform dropout placement after hidden layers (if #hidden_layer > 1)
- Parameters:
input_dim (int) – The dimensionality of the input data
output_dim – The dimensionality of the output data
hidden_neurons (int or list[int], optional) – The number of neurons in each hidden layer, defaults to 50
hidden_layers (int, optional) – The number of layer(s) in the network, defaults to 2
dropout (bool, optional) – Whether to apply dropout regularization, defaults to False
dropout_input (bool, optional) – Whether to apply dropout to the input layer, defaults to False
dropout_input_p (float, optional) – The probability of dropout for the input layer, defaults to 0.5
dropout_hidden (bool, optional) – Whether to apply dropout to the hidden layer, defaults to False
dropout_hidden_p (float, optional) – The probability of dropout for the hidden layer, defaults to 0.5
config (list[dict], optional) – A list of the module layer configuration dictionaries
Methods
Sequentially forward through all modules in model_list to transform input tensor.
Attributes