osl_dynamics.simulation.sm#

Classes for simulating a soft mixture of modes.

Module Contents#

Classes#

MixedSine

Simulates sinusoidal oscilations in mode time courses.

MixedSine_MVN

Simulates sinusoidal alphas with a multivariable normal observation

MSess_MixedSine_MVN

Simulates sinusoidal alphas with a multivariable normal observation model

class osl_dynamics.simulation.sm.MixedSine(n_modes, relative_activation, amplitudes, frequencies, sampling_frequency)[source]#

Simulates sinusoidal oscilations in mode time courses.

Parameters:
  • n_modes (int) – Number of modes.

  • relative_activation (np.ndarray or list) – Average value for each sine wave. Note, this might not be the mean value for each mode time course because there is a softmax operation. This argument can use use to change the relative values of each mode time course.

  • amplitudes (np.ndarray or list) – Amplitude of each sinusoid.

  • frequencies (np.ndarray or list) – Frequency of each sinusoid.

  • sampling_frequency (float) – Sampling frequency.

generate_modes(n_samples)[source]#
class osl_dynamics.simulation.sm.MixedSine_MVN(n_samples, relative_activation, amplitudes, frequencies, sampling_frequency, means, covariances, n_covariances_act=1, n_modes=None, n_channels=None, observation_error=0.0)[source]#

Bases: osl_dynamics.simulation.base.Simulation

Simulates sinusoidal alphas with a multivariable normal observation model.

Parameters:
  • n_samples (int) – Number of samples to draw from the model.

  • relative_activation (np.ndarray or list) – Average value for each sine wave. Note, this might not be the mean value for each mode time course because there is a softmax operation. This argument can use use to change the relative values of each mode time course. Shape must be (n_modes,).

  • amplitudes (np.ndarray or list) – Amplitude of each sinusoid. Shape must be (n_modes,).

  • frequencies (np.ndarray or list) – Frequency of each sinusoid. Shape must be (n_modes,).

  • sampling_frequency (float) – Sampling frequency.

  • means (np.ndarray or str) – Mean vector for each mode, shape should be (n_modes, n_channels). Either a numpy array or 'zero' or 'random'.

  • covariances (np.ndarray or str) – Covariance matrix for each mode, shape should be (n_modes, n_channels, n_channels). Either a numpy array or 'random'.

  • n_covariances_act (int, optional) – Number of iterations to add activations to covariance matrices.

  • n_modes (int, optional) – Number of modes.

  • n_channels (int, optional) – Number of channels.

  • observation_error (float, optional) – Standard deviation of the error added to the generated data.

__getattr__(attr)[source]#
standardize()[source]#
class osl_dynamics.simulation.sm.MSess_MixedSine_MVN(n_samples, relative_activation, amplitudes, frequencies, sampling_frequency, session_means, session_covariances, n_covariances_act=1, n_modes=None, n_channels=None, n_sessions=None, embeddings_dim=None, spatial_embeddings_dim=None, embeddings_scale=None, n_groups=None, between_group_scale=None, observation_error=0.0)[source]#

Bases: osl_dynamics.simulation.base.Simulation

Simulates sinusoidal alphas with a multivariable normal observation model for each session.

Parameters:
  • n_samples (int) – Number of samples per session to draw from the model.

  • relative_activation (np.ndarray or list) – Average value for each sine wave. Note, this might not be the mean value for each mode time course because there is a softmax operation. This argument can use use to change the relative values of each mode time course. Shape must be (n_modes,).

  • amplitudes (np.ndarray or list) – Amplitude of each sinusoid. Shape must be (n_modes,).

  • frequencies (np.ndarray or list) – Frequency of each sinusoid. Shape must be (n_modes,).

  • sampling_frequency (float) – Sampling frequency.

  • session_means (np.ndarray or str) – Session mean vector for each mode, shape should be (n_sessions, n_modes, n_channels). Either a numpy array or 'zero' or 'random'.

  • session_covariances (np.ndarray or str) – Session covariance matrix for each mode, shape should be (n_sessions, n_modes, n_channels, n_channels). Either a numpy array or 'random'.

  • n_covariances_act (int, optional) – Number of iterations to add activations to covariance matrices.

  • n_modes (int, optional) – Number of modes.

  • n_channels (int, optional) – Number of channels.

  • n_sessions (int, optional) – Number of sessions.

  • embeddings_dim (int, optional) – Number of dimensions for embedding vectors.

  • spatial_embeddings_dim (int, optional) – Number of dimensions for spatial embedding vectors.

  • embeddings_scale (float, optional) – Scale of variability between session observation parameters.

  • n_groups (int, optional) – Number of groups when session means or covariances are 'random'.

  • between_group_scale (float, optional) – Scale of variability between groups.

  • observation_error (float, optional) – Standard deviation of the error added to the generated data.

__getattr__(attr)[source]#
standardize()[source]#