Skip to main content

Namespaces and attributes

In a Neptune Run object, attributes and namespaces provide a folder-like structure for the metadata you log:

  • An attribute represents a location for storing a piece of metadata.
  • Attribute can be organized under namespaces, which can be nested.
run
|-- namespace
|-- attribute:Float
|-- attribute:FloatSeries
|-- namespace
|-- namespace
|-- attribute:String

In the above example, Float, FloatSeries, and String refer to type of the attribute. For the full reference, see Attribute types.

note

In Neptune 2.x, attributes are called fields.

Nested namespaces

See an example of different levels of namespace nesting:

Python code
run.log_configs(
{
# Flat:
"batch_size": 64,
# Nested:
"params/act": "ReLU",
# Nested twice:
"params/opt/lr": 0.001,
}
)
Resulting metadata structure
run
|-- "batch_size": 64
|-- "params/"
|-- "act": "ReLU"
|-- "opt/"
|-- "lr": 0.001

Attribute types and limitations

A attribute can contain data of a particular type.

Namespaces can contain multiple attributes of various types, but a attribute is always fixed to a type.

The type determines how you can visualize the attribute in the app or operate on it in the code.

View metadata in Neptune app

When you click on a run in the app, you can browse the complete metadata structure in the All metadata tab.

What you log:

from neptune_scale import Run

run = Run()
run.log_configs(
{"params/activation": "ReLU"}
)

What you see:

Text attribute in run metadata view

Comparing attribute values

You can view, track, and compare the logged values in the All runs tab in the Neptune app.

Note that in the experiments table, Neptune compares values of attributes that have the same data type. For example, if a attribute named batch_size stores an integer in RUN-1 but a float in RUN-2, Neptune treats them as two different attributes that aren't comparable. As a result, the runs table will have two columns named batch_size: one for each data type.