Update Scalar reporting example

This commit is contained in:
revital 2025-04-27 09:46:59 +03:00
parent e83c27c23b
commit 060f4e78b5
5 changed files with 19 additions and 2 deletions

View File

@ -7,7 +7,8 @@ demonstrates explicit scalar reporting. ClearML reports scalars in the **ClearML
When the script runs, it creates a task named `scalar reporting` in the `examples` project.
To reports scalars, call [`Logger.report_scalar()`](../../references/sdk/logger.md#report_scalar).
## Reporting Scalar Series
To report scalar series, 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
`title` arguments.
@ -31,4 +32,20 @@ for i in range(100):
)
```
![image](../../img/examples_reporting_14.png)
![Scalars series](../../img/examples_reporting_14.png#light-mode-only)
![Scalars series](../../img/examples_reporting_14_dark.png#dark-mode-only)
## Reporting Single Scalar Values
To report single scalar values (individual metrics, not part of a series), use [`Logger.report_single_value()`](../../references/sdk/logger.md#report_single_value).
```python
# Report individual scalar values
Logger.current_logger().report_single_value(name="metric A", value=486)
Logger.current_logger().report_single_value(name="metric B", value=305.95)
```
Single value scalars are shown in the UI in the task's **SCALARS** tab under the `Summary` table.
![Single scalars](../../img/examples_reporting_14a.png#light-mode-only)
![Single scalars](../../img/examples_reporting_14a_dark.png#dark-mode-only)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB