Merge branch 'main' of https://github.com/allegroai/clearml-docs into images_4

This commit is contained in:
revital
2025-04-30 10:28:15 +03:00
28 changed files with 158 additions and 130 deletions

View File

@@ -17,7 +17,7 @@ In the ``clearml`` GitHub repository, this example includes a clickable icon to
## Scalars
To reports scalars, call [`Logger.report_scalar()`](../../references/sdk/logger.md#report_scalar).
To report scalars, call [`Logger.report_scalar()`](../../references/sdk/logger.md#report_scalar).
The scalar plots appear in the **web UI** in **SCALARS**.
```python

View File

@@ -49,7 +49,7 @@ flags.DEFINE_string('echo5', '5', 'Text to echo.', module_name='test')
```
TensorFlow Definitions appear in **HYPEPARAMETERS** **>** **TF_DEFINE**.
TensorFlow Definitions appear in **HYPERPARAMETERS** **>** **TF_DEFINE**.
![TF Defines](../../img/examples_reporting_hyper_param_03.png#light-mode-only)
![TF Defines](../../img/examples_reporting_hyper_param_03_dark.png#dark-mode-only)

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)

View File

@@ -3,15 +3,46 @@ title: Text Reporting
---
The [text_reporting.py](https://github.com/clearml/clearml/blob/master/examples/reporting/text_reporting.py) script
demonstrates reporting explicit text by calling [`Logger.report_text()`](../../references/sdk/logger.md#report_text).
ClearML reports the text in the **ClearML Web UI**, in the task's **CONSOLE** tab.
demonstrates reporting text output and samples.
When the script runs, it creates a task named `text reporting` in the `examples` project.
## Reporting Text to Console
To report text to the task console, call [`Logger.report_text()`](../../references/sdk/logger.md#report_text):
```python
# report text
Logger.current_logger().report_text("hello, this is plain text")
```
![image](../../img/examples_reporting_text.png)
Text reported with `Logger.report_text()` appears in the task's **CONSOLE** tab in the ClearML Web UI.
![Text to console](../../img/examples_reporting_text.png#light-mode-only)
![Text to console](../../img/examples_reporting_text_dark.png#dark-mode-only)
## Reporting Text as Debug Samples
To report longer text as a debug sample (e.g., logs, large text outputs, or structured text files),
use [`Logger.report_media()`](../../references/sdk/logger.md#report_media) with a text stream and `.txt` file extension:
```python
text_to_send = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse ac justo ut dolor scelerisque posuere.
...
"""
Logger.current_logger().report_media(
title="text title",
series="text series",
iteration=1,
stream=six.StringIO(text_to_send),
file_extension=".txt",
)
```
Text samples appear in the task's **DEBUG SAMPLES** tab in the ClearML Web UI.
![Text debug sample](../../img/examples_reporting_text_debug.png#light-mode-only)
![Text debug sample](../../img/examples_reporting_text_debug_dark.png#dark-mode-only)