ray.rllib.utils.metrics.metrics_logger.MetricsLogger.peek#

MetricsLogger.peek(key: str | Tuple[str, ...] | None = None, default=None, compile: bool = True, throughput: bool = False, latest_merged_only: bool = False) Any[source]#

Returns the reduced values found in this MetricsLogger.

Note that calling this method does NOT cause an actual underlying value list reduction, even though reduced values are being returned. It’ll keep all internal structures as-is. By default, this returns a single reduced value or, if the Stats object has no reduce method, a list of values. When when compile is False, the result is a list of one or more values.

Parameters:
  • key – The key/key sequence of the sub-structure of self, whose (reduced) values to return.

  • default – An optional default value in case key cannot be found in self. If default is not provided and key cannot be found, throws a KeyError.

  • compile – If True, the result is compiled into a single value if possible.

  • throughput – If True, the throughput is returned instead of the actual (reduced) value.

  • latest_merged_only – If True, only considers the latest merged values. This parameter only works on aggregation loggers (root or intermediate).

Returns:

The (reduced) values of the (possibly nested) sub-structure found under the given key or key sequence.