bspysmg.model.training#
File containing functions for training a surrogate model in pytorch taking into account the error in nano amperes.
Functions
|
Performs the training step of a model within a single epoch and returns the current loss and current trained model. |
|
Performs the validation step of a model within a single epoch and returns the validation loss. |
|
It loads the training and validation datasets from the npz file specified in the field data/dataset_paths of the configs dictionary. |
|
Initializes a random seed for training. |
|
Plots error vs output and error histogram for given dataset and saves it to specified directory. |
|
Copies input tensors from CPU to GPU device for processing. |
|
Performs the training of a model and returns the trained model, training loss validation loss. |