easypheno.model.localcnn

Module Contents

Classes

LocalCnn

Implementation of a class for a Locally-connected Convolutional Neural Network (LocalCNN).

class easypheno.model.localcnn.LocalCnn(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._tensorflow_model.TensorflowModel

Implementation of a class for a Locally-connected Convolutional Neural Network (LocalCNN).

See BaseModel and TensorflowModel 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 = onehot
possible_encodings = ['onehot']
define_model(self)

Definition of a LocalCNN network.

Architecture:

  • LocallyConnected1D, BatchNorm, Dropout, MaxPool1D, Flatten

  • N_LAYERS of (Dense + BatchNorm + Dropout)

  • Dense output layer

Kernel size for LocallyConnectedLayer and max pooling layer may be fixed or optimized. Same applies for stride, number of units in the first dense layer and percentage decrease after each layer.

Return type

tensorflow.keras.Sequential

define_hyperparams_to_tune(self)

See BaseModel for more information on the format.

See TensorflowModel for more information on hyperparameters common for all tensorflow models.

Return type

dict