This function trains a given model using the provided training data.
Currently, the data loaded is set to have multiple sub-processes.
A high enough number of workers assures that CPU computations are efficiently managed, i.e. that the bottleneck is indeed the neural network's forward and backward operations on the GPU (and not data generation)
Loader memory is also pinned, to speed up data transfer from CPU to GPU by using the page-locked memory.
Train data is also re-shuffled at each training epoch.
Args:
data_parameters(dict):{
paramters
data_parameters (dict): Dictionary containing relevant information for the datafiles.
data_parameters = {
'data_directory': 'path/to/directory'
'train_data_file': 'training_data'
'train_output_targets': 'training_targets'
'test_data_file': 'testing_data'
'test_target_file': 'testing_targets'
}
training_parameters(dict):{
paraters
training_parameters(dict): Dictionary containing relevant hyperparameters for training the network.
training_parameters = {
'training_batch_size': 5
'test_batch_size: 5
'use_pre_trained': False
'pre_trained_path': 'pre_trained/path'
'experiment_name': 'experiment_name'
'learning_rate': 1e-4
'optimizer_beta': (0.9, 0.999)
'optimizer_epsilon': 1e-8
'optimizer_weigth_decay': 1e-5
'number_of_epochs': 10
'loss_log_period': 50
'learning_rate_scheduler_step_size': 3
'learning_rate_scheduler_gamma': 1e-1
'use_last_checkpoint': True
'final_model_output_file': 'path/to/model'
}
network_parameters (dict): Contains information relevant parameters = {
network_parameters (dict): Contains information relevant parameters