Config¶
Configuration and model building utilities.
Build Module¶
build_module(config, hyperpar=None)
¶
Build a module based on the provided configuration. Every (possibly nested) dictionary with a 'class' key will be replaced by an instance initialized with arguments and keywords provided as 'args' and 'kwargs' keys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Union[str, Dict, List]
|
The configuration for building the module. |
required |
hyperpar
|
Union[str, Dict, None]
|
The hyperparameters for the module. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
list | dict | Callable
|
Union[List, Dict, Callable]: The built module. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If |
Source code in aimnet/config.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |