easypheno.model.mlp

Module Contents

Classes

Mlp

Implementation of a class for a feedforward Multilayer Perceptron (MLP).

class easypheno.model.mlp.Mlp(task, optuna_trial, encoding=None, n_outputs=1, n_features=None, width_onehot=None, batch_size=None, n_epochs=None, early_stopping_point=None)

Bases: easypheno.model._torch_model.TorchModel

Implementation of a class for a feedforward Multilayer Perceptron (MLP).

See BaseModel and TorchModel for more information on the attributes.

Parameters
  • task (str) –

  • optuna_trial (optuna.trial.Trial) –

  • encoding (str) –

  • n_outputs (int) –

  • n_features (int) –

  • width_onehot (int) –

  • batch_size (int) –

  • n_epochs (int) –

  • early_stopping_point (int) –

standard_encoding = 012
possible_encodings = ['012']
define_model(self)

Definition of an MLP network.

Architecture:

  • N_LAYERS of (Linear + BatchNorm + Dropout)

  • Linear output layer

Number of units in the first linear layer and percentage decrease after each may be fixed or optimized.

Return type

torch.nn.Sequential

define_hyperparams_to_tune(self)

See BaseModel for more information on the format.

See TorchModel for more information on hyperparameters common for all torch models.

Return type

dict