log_configs()
Logs the specified metadata to a Neptune run.
You can log configurations or other single values. Pass the data as a dataclass or a mapping-like object, where:
- keys are strings specifying the path to the metadata in the run structure.
- values are the configurations or other single values to log.
For example, {"parameters/learning_rate": 0.001}
. In the attribute path, each forward slash /
nests the attribute under a namespace. Use namespaces to structure the metadata into meaningful categories.
Parameters
Configs or other values to log, as a dict
, dataclass, or other mapping-like object with an .items()
method.
Available types: float
, integer
, Boolean
, string
, and datetime
.
Any datetime
values that don't have the tzinfo
attribute set are assumed to be in the local timezone.
Flatten nested dictionaries and dataclasses before logging.
Cast unsupported types to strings before logging.
Examples
Create a run and log metadata:
from neptune_scale import Run
if __name__ == "__main__":
run = Run(experiment_name=...)
run.log_configs(
{
"parameters/learning_rate": 0.001,
"parameters/batch_size": 64,
},
)
Handle nested structures and type casting:
data = {
"metrics": {
"token_count": 76420,
"agg": {
"loss": None,
"acc": None,
}
},
"some_list": [1, "test", None],
}
if __name__ == "__main__":
run = Run(experiment_name=...)
run.log_configs(
data=data,
flatten=True,
cast_unsupported=True,
)