Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper model register #189

Open
bryanlimy opened this issue Feb 26, 2024 · 0 comments
Open

Proper model register #189

bryanlimy opened this issue Feb 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bryanlimy
Copy link
Member

bryanlimy commented Feb 26, 2024

Currently, MODEL_REGISTER is a dictionary of emulators where all the emulators would be initialized when we call _get_models.

MODEL_REGISTRY = {
    "SecondOrderPolynomial": SecondOrderPolynomial(),
    "RBF": RBF(),
    "RandomForest": RandomForest(),
    "GradientBoosting": GradientBoosting(),
    "GaussianProcessSk": GaussianProcessSk(),
    "SupportVectorMachines": SupportVectorMachines(),
    "XGBoost": XGBoost(),
    "NeuralNetSk": NeuralNetSk(),
    "NeuralNetTorch": NeuralNetTorch(module="mlp"),
    # "GaussianProcess": GaussianProcess,

Since MODEL_REGISTER is a dictionary, it caches the initialized module and would return initialized module instead of returning a new instance of the module when we call get_models again. This would lead to unexpected errors (i.e. shape mismatch).

As a hotfix 3db7e7e, we added deepcopy in _get_models upon initialization, but a proper model register that return an instance of a module is needed.

@bryanlimy bryanlimy added the bug Something isn't working label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Product backlog
Development

No branches or pull requests

1 participant