osl_dynamics.models.base.ConfigBase#

class osl_dynamics.models.base.ConfigBase#

Settings shared by all models.

Parameters:
init_methodstr, optional

Initialization method used by initialization and train: 'random_state_time_course', 'random_subset', 'nfindr' or 'single_subject'.

n_initint, optional

Number of initializations.

n_init_epochsint, optional

Number of epochs for each initialization.

init_takefloat, optional

Fraction of the dataset to use in the initialization.

batch_sizeint

Mini-batch size.

learning_ratefloat

Learning rate.

learning_rate_decayfloat, optional

Decay of the learning rate. In epoch e, the learning rate is learning_rate * exp(-learning_rate_decay * e), where e is counted from the end of KL annealing in models that use it.

gradient_clipfloat, optional

Value to clip gradients by. This is the clipnorm argument passed to the Keras optimizer.

n_epochsint

Number of training epochs.

optimizerstr, optional

Name of a Keras optimizer.

optimizer_kwargsdict, optional

Keyword arguments for the optimizer.

loss_reductionstr, optional

How should we reduce the time dimension in the loss? Either 'mean' or 'sum'.

multi_gpubool, optional

Should we use multiple GPUs for training? If so, the last batch of an epoch is dropped if it is smaller than batch_size (for a Data object or a dataset from osl_dynamics.data.load_tfrecord_dataset()).

best_ofint, optional

Number of full training runs in train. Each run includes its own initialization. The run with the lowest free energy is kept.