MLBazaar / MLPrimitives

Primitives for machine learning and data science.
https://mlbazaar.github.io/MLPrimitives
MIT License
69 stars 38 forks source link

Building model within `fit` in `keras` adapter #267

Closed sarahmish closed 2 years ago

sarahmish commented 2 years ago

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).

https://github.com/MLBazaar/MLPrimitives/blob/19f00492cf8a73eb6f89f3146ec442257babfc6c/mlprimitives/adapters/keras.py#L101-L104

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)