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

Lift gretel model compatibility to separate module #30

Closed
wants to merge 2 commits into from

Conversation

mikeknep
Copy link
Contributor

What's here

Make it easier to find the "compatibility rules" for models by lifting the logic to its own module.

Why not add this logic to the specific model classes? Wouldn't that be more polymorphic?

The model classes (GretelLSTM, GretelCTGAN, etc.) are wrappers around specific configurations from the blueprints repo. They do not represent every possible configuration of that model type. If a user wants to run a customized LSTM config, for example, they subclass GretelModel, not GretelLSTM:

class MyLstm(GretelModel):
    config = "/path/to/my_lstm.yml"

Note: they could subclass GretelLSTM, but 1) it's easier to tell people to just subclass GretelModel regardless of model type, and/because 2) this ultimately treats the model configuration as the source of truth.

If someone mistakenly created a custom Gretel model like this...

class MyGptX(GretelGPTX):
    config = "/path/to/my_amplify.yml"

...Benchmark will treat this as an Amplify model, because basically all it does with the class instance is grab the config attribute (and the name—the results output will show the name as MyGptX.)

@mikeknep
Copy link
Contributor Author

mikeknep commented Nov 9, 2022

Closing this in favor of a larger refactor of benchmark models, which will be in a separate PR.

@mikeknep mikeknep closed this Nov 9, 2022
@mikeknep mikeknep deleted the mk/compatibility branch November 9, 2022 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant