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

Building model within fit in keras adapter #267

Closed
sarahmish opened this issue Dec 31, 2021 · 0 comments · Fixed by #271
Closed

Building model within fit in keras adapter #267

sarahmish opened this issue Dec 31, 2021 · 0 comments · Fixed by #271
Assignees
Labels
internal improvement This is an improvement that does not add new functionality
Milestone

Comments

@sarahmish
Copy link
Contributor

  • MLPrimitives version: 0.3.2
  • Python version: 3.7
  • Operating System: macOS 10.15.6

Description

In keras adapter, we build the model within the fit function, this entails that with every fit call we will rebuild the model and thus we cannot "continue" the process of training (i.e. call fit twice to train the same model).

def fit(self, X, y, **kwargs):
self._augment_hyperparameters(X, 'input', kwargs)
self._augment_hyperparameters(y, 'target', kwargs)
self.model = self._build_model(**kwargs)

Is this the expected behavior? Or should there be a flag to indicate if this is the first call to fit, then build the model, otherwise continue

if not self._fitted:
    self._augment_hyperparameters(X, 'input', kwargs)
    self._augment_hyperparameters(y, 'target', kwargs)
    self.model = self._build_model(**kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal improvement This is an improvement that does not add new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant