osl_dynamics.models.base#

Base classes and settings shared by the models.

Modules#

  • configs: settings shared by all models (ConfigBase) and groups of settings shared by several models.

  • model: KerasModelBase (training step) and ModelBase (fit, train, freeze, save/load, etc.).

  • markov: models with a hidden Markov chain (HMM, HMM-Poisson, HMM-Dirichlet, HIVE). The posterior of the states is calculated with the Baum-Welch algorithm and the transition probability matrix is updated with an exponential moving average.

  • variational: models trained with amortized variational inference (DyNeMo, SC-DyNeMo, DyNeStE, M-DyNeMo, DIVE).

  • initialization: initialization methods of every model (multi-start: candidate initializations are trained briefly and the best is kept) and the N-FINDR estimate of mode covariances.

  • observation: getters, setters and regularizers shared by models with the same observation model.

  • legacy: loading models saved with osl-dynamics 3.0 to 3.9.

All classes can be imported from osl_dynamics.models.base.

Classes#

ConfigBase

Settings shared by all models.

MarkovConfig

Settings for a hidden Markov chain.

KLAnnealingConfig

Settings for KL annealing.

VariationalConfig

Settings for amortized variational inference.

AlphaTemperatureConfig

Settings for the softmax temperature of alpha.

MVNConfig

Settings for a multivariate normal observation model.

RNNConfig

Settings for the inference and model networks.

SessionConfig

Settings for session-specific observation model parameters.

InitializationMixin

Initialization methods of ModelBase.

KerasModelBase

Keras model with the training step shared by all models.

ModelBase

Base class for all models.

MarkovKerasModelBase

Keras model with a hidden Markov chain.

MarkovModelBase

Base class for models with a hidden Markov chain.

VariationalKerasModelBase

Keras model trained with amortized variational inference.

VariationalModelBase

Base class for models trained with amortized variational inference.

MVNMixin

Methods for models whose Keras model has an MVNLayer called

SessionMVNMixin

Methods for models whose Keras model has a SessionMVNLayer called

Functions#

document_parameters(cls)

Class decorator that adds the parameters of the base classes to the

nfindr_covariances(time_series, n_modes[, ...])

Estimate mode covariances for a soft mixture with N-FINDR.