Skip to content

docs: Marked step and data as mandatory in log_metrics #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ __Parameters__

| Name | Type | Default | Description |
|-------------|------------------------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `step` | `Union[float, int]`, optional | `None` | Index of the log entry. Must be increasing. If not specified, the `log_metrics()` call increments the step starting from the highest already logged value. **Tip:** Using float rather than int values can be useful, for example, when logging substeps in a batch. |
| `data` | `Dict[str, Union[float, int]]` | `None` | Dictionary of metrics to log. Each metric value is associated with a step. To log multiple metrics at once, pass multiple key-value pairs. |
| `step` | `Union[float, int]` | `None` | Index of the log entry. Must be increasing. <br> **Tip:** Using float rather than int values can be useful, for example, when logging substeps in a batch. |
| `timestamp` | `datetime`, optional | `None` | Time of logging the metadata. |
| `data` | `Dict[str, Union[float, int]]`, optional | `None` | Dictionary of metrics to log. Each metric value is associated with a step. To log multiple metrics at once, pass multiple key-value pairs. |

__Examples__

Expand All @@ -281,8 +281,8 @@ from neptune_scale import Run

with Run(...) as run:
run.log_metrics(
step=1.2,
data={"loss": 0.14, "acc": 0.78},
step=1.2,
)
```

Expand Down
14 changes: 6 additions & 8 deletions src/neptune_scale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ def _create_run(

def log_metrics(
self,
step: Optional[Union[float, int]] = None,
data: Dict[str, Union[float, int]],
step: Union[float, int],
timestamp: Optional[datetime] = None,
data: Optional[Dict[str, Union[float, int]]] = None,
) -> None:
"""
Logs the specified metrics to a Neptune run.
Expand All @@ -419,14 +419,12 @@ def log_metrics(
Use namespaces to structure the metadata into meaningful categories.

Args:
step: Index of the log entry. Must be increasing.
If not specified, the log_metrics() call increments the step starting from the highest
already logged value.
Tip: Using float rather than int values can be useful, for example, when logging substeps in a batch.
timestamp: Time of logging the metadata.
data: Dictionary of metrics to log.
Each metric value is associated with a step.
To log multiple metrics at once, pass multiple key-value pairs.
step: Index of the log entry. Must be increasing.
Tip: Using float rather than int values can be useful, for example, when logging substeps in a batch.
timestamp (optional): Time of logging the metadata.


Examples:
Expand All @@ -435,8 +433,8 @@ def log_metrics(

with Run(...) as run:
run.log_metrics(
step=1.2,
data={"loss": 0.14, "acc": 0.78},
step=1.2,
)
```
"""
Expand Down
Loading