2021-05-13 23:48:51 +00:00
|
|
|
---
|
|
|
|
title: Scalars Reporting
|
|
|
|
---
|
|
|
|
|
|
|
|
The [scalar_reporting.py](https://github.com/allegroai/clearml/blob/master/examples/reporting/scalar_reporting.py) script
|
2022-05-22 07:27:30 +00:00
|
|
|
demonstrates explicit scalar reporting. ClearML reports scalars in the **ClearML Web UI** **>** experiment details
|
|
|
|
**>** **SCALARS** tab.
|
2021-05-13 23:48:51 +00:00
|
|
|
|
2023-09-04 12:40:42 +00:00
|
|
|
When the script runs, it creates an experiment named `scalar reporting` in the `examples` project.
|
2021-05-13 23:48:51 +00:00
|
|
|
|
2024-02-11 14:57:55 +00:00
|
|
|
To reports scalars, call [`Logger.report_scalar()`](../../references/sdk/logger.md#report_scalar).
|
|
|
|
To report more than one series on the same plot, use the same `title` argument. For different plots, use different
|
2021-05-13 23:48:51 +00:00
|
|
|
`title` arguments.
|
|
|
|
|
2021-12-14 13:12:30 +00:00
|
|
|
```python
|
|
|
|
# report two scalar series on the same graph
|
|
|
|
for i in range(100):
|
|
|
|
Logger.current_logger().report_scalar(
|
|
|
|
"unified graph", "series A", iteration=i, value=1./(i+1)
|
|
|
|
)
|
|
|
|
Logger.current_logger().report_scalar(
|
|
|
|
"unified graph", "series B", iteration=i, value=10./(i+1)
|
|
|
|
)
|
2021-05-13 23:48:51 +00:00
|
|
|
|
2021-12-14 13:12:30 +00:00
|
|
|
# report two scalar series on two different graphs
|
|
|
|
for i in range(100):
|
|
|
|
Logger.current_logger().report_scalar(
|
|
|
|
"graph A", "series A", iteration=i, value=1./(i+1)
|
|
|
|
)
|
|
|
|
Logger.current_logger().report_scalar(
|
|
|
|
"graph B", "series B", iteration=i, value=10./(i+1)
|
|
|
|
)
|
|
|
|
```
|
2021-05-13 23:48:51 +00:00
|
|
|
|
|
|
|
![image](../../img/examples_reporting_14.png)
|