denspp.offline.dnn.pytorch_config_model#

Module Contents#

Classes#

ConfigPytorch

Class for handling the PyTorch training/inference pipeline Attributes: model_name: String with the model name patience: Integer value with number of epochs before early stopping optimizer: String with PyTorch optimizer name loss: String with method name for the loss function deterministic_do: Boolean if deterministic training should be done deterministic_seed: Integer with the seed for deterministic training num_kfold: Integer value with applying k-fold cross validation num_epochs: Integer value with number of epochs batch_size: Integer value with batch size data_split_ratio: Float value for splitting the input dataset between training and validation data_do_shuffle: Boolean if data should be shuffled before training custom_metrics: List with string of custom metrics to calculate during training

Data#

API#

class denspp.offline.dnn.pytorch_config_model.ConfigPytorch[source]#

Class for handling the PyTorch training/inference pipeline Attributes: model_name: String with the model name patience: Integer value with number of epochs before early stopping optimizer: String with PyTorch optimizer name loss: String with method name for the loss function deterministic_do: Boolean if deterministic training should be done deterministic_seed: Integer with the seed for deterministic training num_kfold: Integer value with applying k-fold cross validation num_epochs: Integer value with number of epochs batch_size: Integer value with batch size data_split_ratio: Float value for splitting the input dataset between training and validation data_do_shuffle: Boolean if data should be shuffled before training custom_metrics: List with string of custom metrics to calculate during training

model_name: str#

None

patience: int#

None

optimizer: str#

None

loss: str#

None

deterministic_do: bool#

None

deterministic_seed: int#

None

num_kfold: int#

None

num_epochs: int#

None

batch_size: int#

None

data_split_ratio: float#

None

data_do_shuffle: bool#

None

custom_metrics: list#

None

static get_model_overview(print_overview: bool = False, index: str = '') None[source]#

Function for getting an overview of existing models inside library

get_loss_func() Any[source]#

Getting the loss function

load_optimizer(model, learn_rate: float = 0.1) Any[source]#

Loading the optimizer function

get_model(*args, **kwargs)[source]#

Function for loading the model to train

denspp.offline.dnn.pytorch_config_model.DefaultSettingsTrainMSE#

‘ConfigPytorch(…)’

denspp.offline.dnn.pytorch_config_model.DefaultSettingsTrainCE#

‘ConfigPytorch(…)’