Skip to content

MetricsWriter ​

Abstract base class for writing metrics to an output destination.

Source

Methods ​

close ​

python
close() -> None

Close the writer and release any resources.

Source

flush ​

python
flush() -> None

Flush any buffered output to the destination.

Source

write ​

python
write(tag: str, value: float, step: int) -> None

Write a scalar metric value.

Parameters:

  • tag (str) – The metric tag (for example, "Learner/Loss").
  • value (float) – The scalar value.
  • step (int) – The global step.

Source

write_histogram ​

python
write_histogram(tag: str, bin_edges: Sequence[float], bin_counts: Sequence[float], step: int) -> None

Write a pre-binned histogram.

Parameters:

  • tag (str) – The metric tag (for example, "Restarts/Advance_Rate_By_Band").
  • bin_edges (Sequence[float]) – The n + 1 bin boundaries, ascending.
  • bin_counts (Sequence[float]) – The n bin heights.
  • step (int) – The global step.

Source

write_params ​

python
write_params(params: dict[str, Any]) -> None

Write configuration parameters.

Parameters:

  • params (dict[str, Any]) – A dictionary of parameter names and values.

Source