Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

enhance model selection framework with dynamic loading #163

Open

Description

summary

implement a dynamic model selection framework to seamlessly load different model architectures without modifying core code.

background

the current model loading mechanism in run.py uses if-statements to manually check the model name and load the appropriate class. this approach is not scalable and requires modifying core code whenever a new model is added.

proposed solution

create a modular framework that dynamically discovers and loads models from the codebase:

  1. register models using a decorator pattern
  2. implement auto-discovery of models in the models directory
  3. create a factory class for model instantiation
  4. support custom models from external paths

code example

current approach:

if args.model == 'TimeMixer':
 from models.TimeMixer import Model
elif args.model == 'OtherModel':
 from models.OtherModel import Model
# etc.

proposed approach:

from utils.model_registry import get_model
model_class = get_model(args.model)
model = model_class(args)

benefits

  • extensibility: new models can be added without modifying existing code
  • maintainability: reduces code duplication and simplifies the codebase
  • discoverability: makes it easier to understand available models
  • research-friendly: simplifies adding experimental model variants

implementation details

  • create utils/model_registry.py with registration mechanism
  • implement model discovery functionality
  • modify experiment classes to use the registry
  • add documentation about extending with custom models

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /