Saving a settings file¶
In order to launch a training, you need to save the setting file using the interactive tools contained in the folder
notebooks
:offline_settings_training.ipynb
. In this page, we present the different parameters that you will be asked to define. This description will also allow to you to completely understand how flexible is the model implemented (i.e. what you can do using directly this project and what you can’t).
The following screen shot presents an example of the interactive tool to define the settings for a training.
General parameters for training¶
name_model
String Name of the architecture of the network. The name is chosen among the architecture defined in the package MRF.models.
If the chosen model starts by a projection :
normalization
String Type of normalization of the data. The possible types of normalization that can be used are defined in the classNormalization
of the module Training_parameters.initilization
StringType of initilization for the weights of the first linear layer which should perform the projection. The possible types of initialization that can be used are defined in the classInitialization
of the module Training_parameters.dimension_projection
IntDimension of the subspace on which the projection will be performed.namepca
strAbsolute path to the file containing the basis functions obtained with an online PCA algorithm in order to initalize or define the first linear layer supposed to perform the projection. This file needs to be a.mat
file with the basis functions saved with the key wordbasis
. The basis functions need to be saved with the size(number of functions) x (length fingerprint)
.optimizer
StringName of the optimizer used for the training. The possible names to use are defined in the classOptimizer
of the module Training_parameters.lr
FloatLearning rate.noise_type
StringType of noise that you want to use. The different types of noise are defined in the module Training_parameters.noise_level
FloatLevel of noise that you want to use.batch_size
IntBatch size.nb_iterations
IntNumber of iterations.nb_epochs
IntNumber of epochs.complex
BoolSet toTrue
if the input signals are complex valued.loss
Array of StringType of loss used. The array has a length 5 corresponding to the 5 parameters (\(m_{0}^s\), \(T_1^f\), \(T_{2}^f\), \(R\) and \(T_{2}^s\)). The i-th element of this array gives the type of transformation applied to the parameter i. The different type of losses are defined in the class Loss in the module Training_parameters.params
Array of IntDefine the parameters that you want to estimate. Number 0 corresponds to \(m_0^s\), number 1 to \(T_1^f\), etc. (The details are defined in the the module Training_parameters with the vectorsnametoparam
andparamtoname
).minpd
FloatMinimum proton density.maxpd
FloatMaximum proton density.save_name
StringName given to your training.validation
BoolBoolean which is True if you want to track validation loss and errors during the training.If
validation
is True :* `validation_size` **Int** Number of fingerprints used for the validation dataset.
nb_files
StringNumber of files used for training and validation. I recall that your files needs to be saved in a folder with a name that you can choose and that should be located in MRF/Offline/loading_data.path_files
StringName that you gave to the folder located in MRF/Offline/loading_data which contains the files. Two different type of files should be saved in this folder:the files fingerprints1.npy, fingerprints2.npy, … Each file contains an array of size n x (length fingerprint) where n is an integer that should be greater than the batch size chosen. Each fingerprint should be computed considering that the proton density is equal to 1.
the files params1.npy, params2.npy, … Each file contains an array of size
n x (length fingerprint)
and gives the parameters used to compute the fingerprints saved in the files fingerprints1.npy, fingerprints2.npy, …If your loss requires the knowledge of the Cramer Rao Bound, you also need to save n this folder the files CRBs1.npy, CRBs2.npy, … Each file contains an array of size
n x 6
and gives the Cramer Rao Bounds for the parameters \(m_{0}^s\), \(T_1^f\), \(T_{2}^f\), \(R\), \(T_{2}^s\) and \(M_0\) in this order.
If validation
is True :
small_validation_size
Int Number of fingerprints used for the smaller validation dataset.