scvi.module.base.BaseModuleClass.loss

abstract BaseModuleClass.loss(*args, **kwargs)[source]

Compute the loss for a minibatch of data.

This function uses the outputs of the inference and generative functions to compute a loss. This many optionally include other penalty terms, which should be computed here.

This function should return an object of type LossRecorder.

Return type

LossRecorderLossRecorder