Skip to main content
App version: 3.4.14

log_configs()

Python package: neptune-scale

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

data
Dict[str, float | bool | int | str | datetime | list | set | tuple]
optional
default: None

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
bool
optional
default: False

Flatten nested dictionaries and dataclasses before logging.

cast_unsupported
bool
optional
default: False

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,
)