flair.trainers.plugins.MetricRecord#

class flair.trainers.plugins.MetricRecord(name, value, global_step, typ, *, walltime=None)View on GitHub#

Bases: object

Represents a recorded metric value.

__init__(name, value, global_step, typ, *, walltime=None)View on GitHub#

Create a metric record.

Parameters:
  • name (Union[Iterable[str], str]) – Name of the metric.

  • typ (RecordType) – Type of metric.

  • value (Any) – Value of the metric (can be anything: scalar, tensor, image, etc.).

  • global_step (int) – The time_step of the log. This should be incremented the next time this metric is logged again. E.g. if you log every epoch, set the global_step to the current epoch.

  • walltime (Optional[float]) – Time of recording this metric.

Methods

__init__(name, value, global_step, typ, *[, ...])

Create a metric record.

histogram(name, value, global_step, *[, ...])

is_type(typ)

scalar(name, value, global_step, *[, walltime])

scalar_list(name, value, global_step, *[, ...])

string(name, value, global_step, *[, walltime])

Attributes

is_histogram

is_scalar

is_scalar_list

is_string

joined_name

property joined_name: str#
classmethod scalar(name, value, global_step, *, walltime=None)View on GitHub#
classmethod scalar_list(name, value, global_step, *, walltime=None)View on GitHub#
classmethod string(name, value, global_step, *, walltime=None)View on GitHub#
classmethod histogram(name, value, global_step, *, walltime=None)View on GitHub#
is_type(typ)View on GitHub#
property is_scalar#
property is_scalar_list#
property is_string#
property is_histogram#