In order to make it easier for users to incorporate CREDIT as a library in their own repositories, I would like to add a custom objects registry that users can add to their config file to properly import their own custom models, datasets, pre/post blocks, losses, etc. Example config:
custom_objects:
djformer:
object_type: model # Assigns object to correct registry of datasets, preblocks, postblocks, models, trainers, losses
module_path: djulator.models # importlib supports python module import syntax and can convert file paths to imports
module_name: DJFormer
You can access module imports from strings using importlib.import_module.
Having this custom object registry in place will allow CREDIT users to test out new modules and functionality within the CREDIT CLI and APIs without having to modify the CREDIT library code directly and get us toward the ideal of most users eventually interacting with CREDIT via PyPI and imports or CLI rather than Github.
In order to make it easier for users to incorporate CREDIT as a library in their own repositories, I would like to add a custom objects registry that users can add to their config file to properly import their own custom models, datasets, pre/post blocks, losses, etc. Example config:
You can access module imports from strings using
importlib.import_module.Having this custom object registry in place will allow CREDIT users to test out new modules and functionality within the CREDIT CLI and APIs without having to modify the CREDIT library code directly and get us toward the ideal of most users eventually interacting with CREDIT via PyPI and imports or CLI rather than Github.