Configuration Dataclasses#

Classes#

class BaseConfig[source]#

Bases: object

Base dataclass to hold configuration parameters.

classmethod from_dict(config, new_fields=False)[source]#

Creates a BaseConfig object from a dictionary.

Parameters:
configdict[str, Any]

Configuration dictionary

new_fieldsbool, Optional

Whether to allow new fields in the dictionary, default = False

Returns:
ConfigT

Configuration dataclass

get_changed_fields()[source]#

Gets the set of changed fields in the dataclass.

Returns:
set[str]

Set of changed fields

merge(other, new_fields=False)[source]#

Merges another dataclass into this one.

Parameters:
otherConfigT

Configuration dataclass to merge

new_fieldsbool, Optional

Whether to allow new fields in the other dataclass, default = False

merge_dict(other, new_fields=False)[source]#

Merges a dictionary into this dataclass.

Parameters:
otherdict[str, Any]

Configuration dictionary to merge

new_fieldsbool, Optional

Whether to allow new fields in the dictionary, default = False

to_dict()[source]#

Converts the dataclass to a dictionary.

Returns:
dict[str, Any]

Configuration dictionary

class NetConfig(checkpoints=False, paper='', github='', description='', layers=<factory>)[source]#

Bases: BaseConfig

Dataclass to hold global network configuration parameters.

Attributes:
checkpointsbool

Whether to capture intermediate outputs as checkpoints

paperstr

Reference to the paper describing the network

githubstr

Link to the GitHub repository for the network

descriptionstr

Description of the network

layersdict[str, Any]

Dictionary of default layer configurations

merge_dict(other, new_fields=False)[source]#

Merges a dictionary into this dataclass.

Parameters:
otherdict[str, Any]

Configuration dictionary to merge

new_fieldsbool, Optional

Whether to allow new fields in the dictionary, default = False

class Config(layers=<factory>, net=<factory>)[source]#

Bases: BaseConfig

Dataclass to hold global network and layer configuration parameters.

Attributes:
layerslist[dict[str, Any]]

List of layers

netNetConfig

Network configuration

Type Aliases#

ConfigT#

TypeVar[bound = BaseConfig]