scvi.core.trainers.SemiSupervisedTrainer

class scvi.core.trainers.SemiSupervisedTrainer(model, adata, n_labelled_samples_per_class=50, n_epochs_classifier=1, lr_classification=0.005, classification_ratio=50, seed=0, **kwargs)[source]

Class for the semi-supervised training of an autoencoder.

This parent class can be inherited to specify the different training schemes for semi-supervised learning

Parameters
n_labelled_samples_per_class

number of labelled samples per class

Attributes

default_metrics_to_monitor

kl_weight

scvi_data_loaders_loop

Methods

check_training_status()

Checks if loss is admissible.

compute_metrics()

create_scvi_dl([model, adata, shuffle, …])

data_loaders_loop()

Returns an zipped iterable corresponding to loss signature.

loss(tensors_all, tensors_labelled)

on_epoch_begin()

on_epoch_end()

on_iteration_begin()

on_iteration_end()

on_training_begin()

on_training_end()

on_training_loop(tensors_dict)

register_data_loader(name, value)

train([n_epochs, lr, eps, params])

train_test_validation([model, adata, …])

Creates data loaders train_set, test_set, validation_set.

training_extras_end()

Place to put extra models in eval mode, etc.

training_extras_init(**extras_kwargs)

Other necessary models to simultaneously train.