sakura.models.modules.FCRegressor
- class sakura.models.modules.FCRegressor(input_dim, output_dim, config=None, hidden_neurons=5, hidden_layers=None, output_activation_function='identity', dropout=False, dropout_input=False, dropout_input_p=0.5, dropout_hidden=False, dropout_hidden_p=0.5)
Bases:
ModuleFully connected regressor module class
Module is designed for cell/sample supervision with configurable hidden layers and neurons, output activation functions, and dropout regularization. Use entire latent space or designated dimension(s) as input. Training goal is to predict cell/sample signatures or phenotypes with continuous values (e.g. expression levels of genes or proteins).
- Architecture details:
When config is None, legacy mode 3 hidden layers with structure: Input –> Linear –> CELU –> Linear –> CELU –> Linear –> Activation –> Output
Optional dropout placement after the input layer
Optional but uniform dropout placement after hidden layers (if #hidden_layer > 1)
Final layer always has output_dim neurons with optional activation
- Parameters:
input_dim (int) – The dimensionality of the input data
output_dim (int) – The dimensionality of the output data
config (list[dict], optional) – A list of the module layer configuration dictionaries
hidden_neurons (int or list[int], optional) – The number of neurons in each hidden layer, defaults to 5
hidden_layers (int, optional) – The number of layer(s) in the network
output_activation_function (Literal['relu', 'softmax','identity'], optional) – The activation function for the output layer, defaults to ‘identity’
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
Methods
Sequentially forward through all modules in model_list to transform input tensor.
Attributes