bn_weight_decay = false
enabled = true
Use `` to call user defined hooks.
</details>
<details>
<summary>Instance-level hook</summary>
If the logic of module building are too complicated, instance-level hook may be helpful.
TODO
</details>
<details>
<summary>:sparkles:Lazy Config with simple API</summary>
The core conception of LazyConfig is 'Lazy', which represents a status of delay. Before instantiating, all the parameters will be stored in a special dict which additionally contains what the target class is. So It's easy to alter any parameters of the module and control which module should be instantiated and which module should not.
It's also used to address the defects of plain text configs through python lsp which is able to provide code navigation, auto-completion and more.
`ExCore` implements some nodes - `MoudleNode`, `InternNode`, `ReusedNode`, `ClassNode`, `ConfigHookNode`, `ChainedInvocationWrapper` and `VariableReference` and a `LazyConfig` to manage all nodes.
`ExCore` provides only 2 simple API to build moduels -- 'load' and `build_all`.
Typically, we follow the following procedure.
python
from excore import config
layz_cfg = config.load('xxx.toml')
module_dict, run_info = config.build_all(layz_cfg)
The results of `build_all` are respectively `Primary` modules and `Isolated` objects.
If you only want to use a certain module.
python
from excore import config
layz_cfg = config.load('xxx.toml')
model = lazy_cfg.Model() Model is one of `PrimaryFields`
or
model = layz_cfg['Model']()
If you want to follow other logic to build modules, you can still use `LazyConfig` to adjust the arguments of `node`s and more things.
python
from excore import config
layz_cfg = config.load('xxx.toml')
lazy_cfg.Model.add_params(pre_trained='./')
module_dict, run_info = config.build_all(layz_cfg)
</details>
<details>
<summary>Config print</summary>
python
from excore import config
cfg = config.load_config('xx.toml')
print(cfg)
Result:
╒══════════════════════════╤══════════════════════════════════════════════════════════════════════╕
│ size │ 1024 │
├──────────────────────────┼──────────────────────────────────────────────────────────────────────┤
│ TrainData.CityScapes │ ╒═════════════╤════════════════════════════════════════════════════╕ │
│ │ │ &train_size │ size │ │
│ │ ├─────────────┼────────────────────────────────────────────────────┤ │
│ │ │ !transforms │ ['RandomResize', 'RandomFlip', 'Normalize', 'Pad'] │ │
│ │ ├─────────────┼────────────────────────────────────────────────────┤ │
│ │ │ data_path │ xxx │ │
│ │ ╘═════════════╧════════════════════════════════════════════════════╛ │
├──────────────────────────┼──────────────────────────────────────────────────────────────────────┤
│ Transform.RandomFlip │ ╒══════╤═════╕ │