Metrics
Time-series data that changes over the course of a run: loss, accuracy, learning rate, and any custom scalars you want to chart.
Streams
Every metric value lives on a stream. A stream is just a named series identified by a prefix, like train or eval. You select one by calling exp.metrics(prefix), then .log(...) appends a point.
The unprefixed exp.metrics.log(...) writes to the root stream, which is the right place for run-wide scalars like epoch or step.
Basic Logging
Log scalars by keyword. Nested dicts automatically route to child streams:
The train=dict(...) form is equivalent to exp.metrics("train").log(...). Pick whichever reads better at the call site.
Explicit Streams
When metrics for a stream are produced at different points in the loop, address each stream directly and flush once you have a coherent snapshot:
Stream names are arbitrary; system, lr, grad_norm, etc. all work the same way.
Reading
Read points back by index range:
Per-Batch Logging
Logging every batch with .log() is fine but produces a lot of points. To accumulate batch-level values and emit one summarized row per epoch, see Buffering.
For configuration like learning rate and batch size, use Parameters. For text events and structured logs, see Logging.
Next: Learn about Files to upload models, plots, and artifacts.