-
Notifications
You must be signed in to change notification settings - Fork 50
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
DOC: Add a page to help users transition from tf.keras.wrappers.scikit_learn #124
Comments
I thought SciKeras aimed to be compatible with |
Yes, these are minor changes. I think all of these we've discussed together previously. An example with all of these changes (copied from #112): def build_model(optimizer='adam'):
model = Sequential()
model.add(Flatten(input_shape=(28, 28)))
model.add(Dense(512, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(10, activation='softmax'))
model.compile(optimizer=optimizer,
loss='categorical_crossentropy',
metrics=['accuracy'])
return model
model = KerasClassifier(build_fn=build_model) New: def build_model(optimizer):
model = Sequential()
model.add(Flatten(input_shape=(28, 28)))
model.add(Dense(512, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(10, activation='softmax'))
model.compile(optimizer=optimizer,
loss='categorical_crossentropy',
metrics=['accuracy'])
return model
model = KerasClassifier(model=build_model, optimizer="rmsprop", loss="categorical_crossentropy") |
Why not specify a default of
I like the implementation around def fit(self, X, y, classes=None, ..., **kwargs):
for k, v in kwargs.items():
warn(f"Set fit arguments at initialization (i.e., `BaseWrapper({k}={v})`)")
self.set_parmas(**kwargs) |
Could the same be done for parameters passed to
We could do that, I don't see why not. But I'd like to deprecate that relatively soon. |
The main problem with this approach is that subsequent calls to |
We should have a page noting the differences (not features) vs. the old wrappers. I think so far we only have:
fit
/predict
arguments should be passed to the constructor instead of as kwargs tofit
/predict
.build_fn
tomodel
build_fn
, instead they should be declared in the SciKeras constructorcategorical_crossentropy
loss="categorical_crossentropy"
(orloss=CategoricalCrossentropy
, etc.) needs to be passed to the SciKeras constructor (even for user-compiled models) since we no longer introspect compiled models.The text was updated successfully, but these errors were encountered: