easypheno.model.cnn
Module Contents
Classes
Implementation of a class for a Convolutional Neural Network (CNN). |
- class easypheno.model.cnn.Cnn(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.TorchModelImplementation of a class for a Convolutional Neural Network (CNN).
See
BaseModelandTorchModelfor more information on the attributes.- Parameters
- standard_encoding = onehot
- possible_encodings = ['onehot']
- define_model(self)
Definition of a CNN network.
Architecture:
N_LAYERS of (Conv1d + BatchNorm + Dropout)
MaxPool1d, Flatten, Linear, BatchNorm, Dropout
Linear output layer
Kernel sizes for convolutional and max pooling layers may be fixed or optimized. Same applies for strides, number of output channels of the first convolutional layer, dropout rate, frequency of a doubling of the output channels and number of units in the first linear layer.
- Return type
torch.nn.Sequential
- define_hyperparams_to_tune(self)
See
BaseModelfor more information on the format.See
TorchModelfor more information on hyperparameters common for all torch models.- Return type