sakura.models.modules.LinRegressor

class sakura.models.modules.LinRegressor(input_dim, output_dim, config=None, output_activation_function='identity')

Bases: Module

Simple linear regressor module class

Use simple linear regressor to predict selected expression levels or other continuous phenotypes. Input is entire latent space, or designated dimension(s). Expected to make latent space aligned along linear structure.

When config is None, default structure: Input –> Linear –> Activation –> Output.

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

  • output_activation_function (Literal['relu', 'softmax','identity'], optional) – The activation function for the output layer, defaults to ‘identity’

Methods

forward

Sequentially forward through all modules in model_list to transform input tensor.

Attributes