Comments (3)
Hi,
If you go with the subclassing pattern, you do not need to specify those arguments. The only reason to keep them is for parity with the non-subclassed pattern, where you would need to specify them. I realize this may be confusing, and will note this for when docs get overhauled.
The only thing your example is missing to work properly is a call to super().__init__()
for cooperative inheritance:
class MLPRegressor(KerasRegressor):
def __init__(self, hidden_layer_sizes=(100, )):
super().__init__()
self.hidden_layer_sizes = hidden_layer_sizes
I'll fix the docs to include that :)
from scikeras.
Hi,
If you go with the subclassing pattern, you do not need to specify those arguments. The only reason to keep them is for parity with the non-subclassed pattern, where you would need to specify them. I realize this may be confusing, and will note this for when docs get overhauled.
The only thing your example is missing to work properly is a call to
super().__init__()
for cooperative inheritance:class MLPRegressor(KerasRegressor): def __init__(self, hidden_layer_sizes=(100, )): super().__init__() self.hidden_layer_sizes = hidden_layer_sizesI'll fix the docs to include that :)
Yes of course I forgot super()
, thanks for pointing that out.
Anyway thanks for the answer and for the great package. This is a blessing since it works better than the original and also tf wants to deprecate the skleanr api.
If the documentation were more accurate it would be perfect
Great work
from scikeras.
This should be in the docs now!
from scikeras.
Related Issues (20)
- Citation HOT 1
- SecOps: Security issues found with grPC lib HOT 5
- Bug not fixed yet HOT 1
- Can't load saved model (UnicodeDecodeError) HOT 1
- where to enter `validation_data=(test_x, test_y)` when using KerasRegressor() wrapper HOT 2
- Wrapping custom model subclassing `tf.keras.Model` does not work
- Randomized Seach CV is not working with KerasRegressor HOT 1
- String "loss" being passed to metric_name() instead of loss func name HOT 9
- ValueError: Invalid filepath extension for saving. Please add either a `.keras` extension for the native Keras format (recommended) or a `.h5` extension. HOT 9
- Keras 3 support HOT 6
- TypeError: OneHotEncoder.__init__() got an unexpected keyword argument 'sparse' HOT 9
- How pass a number of neurons in the model for KerasClassifier :Invalid parameter neurons for estimator KerasClassifier.
- OneHotEncoder no longer uses `sparse` keyword HOT 3
- SciKeras 0.13.0 / keras 3.2.1 - ModuleNotFoundError: No module named 'keras.src' HOT 2
- Invalid parameter 'model' for estimator KerasRegressor HOT 2
- Working Scikeras Classifer model now broken with scikeras 0.13. AttributeError: 'Sequential' object has no attribute 'compiled'. HOT 7
- Multi-backend scikeras (Tensorflow, Jax, Pytorch) HOT 2
- Can't serialize a KerasClassifier object after fitting HOT 1
- Extracting the underlying Keras model from the wrapper HOT 2
- How to apply data augmentation? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scikeras.