mofaflex.TrainingOptions#

class mofaflex.TrainingOptions(*, device='cuda', batch_size=0, max_epochs=10000, n_particles=1, lr=0.001, early_stopper_patience=100, save_path=None, mofa_compat=False, seed=None, num_workers=0, pin_memory=False)#

Options for training.

Attributes table#

batch_size

Batch size.

device

Device to run training on.

early_stopper_patience

Number of steps without relevant improvement to stop training.

lr

Learning rate.

max_epochs

Maximum number of training epochs.

mofa_compat

Save model in MOFA2 compatible format.

n_particles

Number of particles for ELBO estimation.

num_workers

Number of data loader workers.

pin_memory

Whether to use pinned memory in the data loader.

save_path

Path to save model.

seed

Seed for the pseudorandom number generator.

Methods table#

Attributes#

TrainingOptions.batch_size: int = 0#

Batch size.

TrainingOptions.device: str | device = 'cuda'#

Device to run training on.

TrainingOptions.early_stopper_patience: int = 100#

Number of steps without relevant improvement to stop training.

TrainingOptions.lr: float = 0.001#

Learning rate.

TrainingOptions.max_epochs: int = 10000#

Maximum number of training epochs.

TrainingOptions.mofa_compat: Literal['full', 'modelonly'] | bool = False#

Save model in MOFA2 compatible format. If True or "full", will include the data in the file. This can result in very large files. "modelonly" will save only the trained model.

Deprecated since version 0.1.1: This option will be removed in MOFA-FLEX 0.2. If you are missing a feature from the MOFA2 R package, please open an issue.

TrainingOptions.n_particles: int = 1#

Number of particles for ELBO estimation.

TrainingOptions.num_workers: int = 0#

Number of data loader workers.

TrainingOptions.pin_memory: bool = False#

Whether to use pinned memory in the data loader.

TrainingOptions.save_path: Path | str | None = None#

Path to save model.

TrainingOptions.seed: int | None = None#

Seed for the pseudorandom number generator.

Methods#