newron.log_metric()


newron.log_metric(key: str, value: float, step: Optional[int] = None) → None

Log a metric under the current run. If no run is active, this method will create a new active run.

Parameters

  • Key - It is a metric name (string). This string may only contain alphanumerics, underscores (_), dashes (-), periods (.), spaces ( ), and slashes (/). All backend stores will support keys up to length 250, but some may support larger keys.
  • Value - It is a metric value (float). Note that some special values such as +/- Infinity may be replaced by other values depending on the store. For example, the SQLAlchemy store replaces +/- Infinity with max / min float values. All backend stores will support values up to length 5000, but some may support larger values
  • Step - It is a metric step (int). Defaults to zero if unspecified.

Example

import newron
#USER CODE
newron.log_metric("mse", 2500.00)