scvi.module.base.BaseModuleClass.forward

BaseModuleClass.forward(tensors, get_inference_input_kwargs=None, get_generative_input_kwargs=None, inference_kwargs=None, generative_kwargs=None, loss_kwargs=None, compute_loss=True)[source]

Forward pass through the network.

Parameters
tensors

tensors to pass through

get_inference_input_kwargs : dict | NoneOptional[dict] (default: None)

Keyword args for _get_inference_input()

get_generative_input_kwargs : dict | NoneOptional[dict] (default: None)

Keyword args for _get_generative_input()

inference_kwargs : dict | NoneOptional[dict] (default: None)

Keyword args for inference()

generative_kwargs : dict | NoneOptional[dict] (default: None)

Keyword args for generative()

loss_kwargs : dict | NoneOptional[dict] (default: None)

Keyword args for loss()

compute_loss

Whether to compute loss on forward pass. This adds another return value.

Return type

Tuple[Tensor, Tensor] | Tuple[Tensor, Tensor, LossRecorder]Union[Tuple[Tensor, Tensor], Tuple[Tensor, Tensor, LossRecorder]]