Asthestarsfalll / ExCore

A Modern Configuration/Registry System designed for deeplearning, with some utils.
https://excore.onism.space/
MIT License
13 stars 0 forks source link

LazyConfig #2

Closed Asthestarsfalll closed 1 year ago

Asthestarsfalll commented 1 year ago

What to do

Switch to LazyConfig.

What is LazyConfig

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.

What's the impact

Provide 2 way to build modules:

  1. call config.build_all and use config hooks to handle sth.
  2. use LazyCconfig object and handle special needs manually in user code