scvi.train._metrics.ElboMetric#

class scvi.train._metrics.ElboMetric(name, mode, interval, **kwargs)[source]#

Bases: Metric

Elbo metric aggregator for scvi-tools experiments.

Parameters:
  • name (str) – Name of metric, used as the prefix of the logged name.

  • mode (Literal['train', 'validation']) – Train or validation, used as the suffix of the logged name.

  • interval (Literal['obs', 'batch']) – The interval over which the metric is computed. If “obs”, the metric value per observation is computed. If “batch”, the metric value per batch is computed.

  • **kwargs – Keyword args for torchmetrics.Metric

Attributes table#

Methods table#

compute()

Compute the metric value.

get_intervals_recorded()

Get intervals recorded.

update(**kwargs)

Updates this metric for one minibatch.

Attributes#

ElboMetric.full_state_update: Optional[bool] = False#
ElboMetric.interval[source]#
ElboMetric.mode[source]#
ElboMetric.name[source]#
ElboMetric.training: bool#

Methods#

ElboMetric.compute()[source]#

Compute the metric value.

ElboMetric.get_intervals_recorded()[source]#

Get intervals recorded.

ElboMetric.update(**kwargs)[source]#

Updates this metric for one minibatch.

Takes kwargs associated with all metrics being updated for a given minibatch. Filters for the relevant metric’s value and updates this metric.