sakura.models.modules.LinClassifier

class sakura.models.modules.LinClassifier(input_dim, output_dim, config=None)

Bases: Module

Simple linear classifier module class

Use single linear layer and softmax activation function to do classification. Useful when simple and linear structure is expected from certain latent dimension.

When config is None, default structure: Input –> Linear –> LogSoftmax –> 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

Methods

forward

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

Attributes