Skip to main content

How References Work

Referencing unnested sections

Simply type in the name of the section. For example:

The value for params refers to the model section. This is like doing:

model = torchvision.models.resnet50()
optimizer = torch.optim.Adam(params=model.parameters())

Referencing nested sections

Use Python syntax when referring to nested sections.

Referring to a List Root child

Use list indices to refer to a specific section within the list.

In this example, the optimizer is using the parameters() of models[0]:

Referring to Dictionary Root child or Group child

Use dictionary keys to refer to a specific section within a dictionary or group.

In this example, the optimizer is using the parameters() of models["fond_indigo"]:

The same syntax applies to dictionary root children.

Referencing parameters

Referencing parameters of a section

Use dictionary syntax, and prefix the section name with two underscores. In this example, the size for cropper will be 256 - 32 = 224:

If the section is nested, the double underscore prefix still goes at the beginning:

Referencing parameters of a section without a callable

A section without a callable is equivalent to a dictionary. So its parameters can be referred to using dictionary key syntax:

Referencing Global Variables

Global variables can be referred to directly by their name (i.e. without any dictionary syntax):