Comments (8)
I think it's a good idea too. I can try to code that and add an error message when using a Functional Model advising you to use the experimental feature.
@bml1g12 predict
and predict_classes
output different arrays (one the probabilities and the other the predicted label of the object to compare with the actual label) so I don't know why it works for you but I think it's not an optimal solution.
from talos.
This is now fixed in the current dev branch.
from talos.
@bml1g12 Yeah you'll get this error right now if you're not using the Sequential
type model. predict_classes
only works with that and doesn't work with the functional model. I think what you've done is something of a hot fix that seems to work with some cases but not others. I would be very careful to be sure that predict
is doing what you want it to! Otherwise, this should be fine.
from talos.
I was trying to use talos with a Keras Functional Model too but surprisingly Keras didn't implemented the predict_classes function on them.
So I come up with a quick fix using argmax(self.keras_model.predict(self.x_val), axis=-1)
that worked for me.
(don't forget to import argmax from numpy)
However it seems that it didn't work for everybody, resulting in weird arrays full of zeros.
I finally looked up the code of predict_classes in the Keras repo and it kind of uses argmax
the way I proposed.
Therefore I'm waiting for suggestions.
from talos.
This is related with #39 and #42.
My suggestion is that we add an option for those that want to use the above under a parameter experimental_functional_support=True for Scan() which simply uses the above instead of the one that is being used otherwise. We need to keep in mind it's not tested (as in #42 it becomes apparent how this might not work for all cases).
@x94carbone @ackRow what do you think about this approach?
from talos.
I think this is ok. Sort of a use-at-your-own-risk kind of option. It weird because I see all over the internet people recommending this fix, but it seems for certain kinds of data input it totally breaks everything.
It is kinda crazy that Keras hasn't addressed this issue by now if you ask me.
from talos.
y_pred = self.keras_model.predict(self.x_val)
seems to be working for me (I ran a keras run with optimal parameters selected by Talos, and got similar results between the two) .
from talos.
@ackRow that's great, thanks so much. At the moment there are 4 live issues related with this, so it seems like high value target :)
from talos.
Related Issues (20)
- talos execution fails of very first example: HOT 1
- Resume run possible? HOT 2
- Key duplication results in exception: param dict vs. csv file stored (e.g., 'loss') HOT 3
- Heatmap always have missing parts HOT 2
- Failed to build scipy while installing talos HOT 1
- Using `Evaluate` with multiple inputs HOT 6
- ImportError: cannot import name 'get_config' HOT 4
- add arguments to the function syntax HOT 1
- Using train, val data HOT 1
- Cannot replicate typical example from documentation HOT 1
- Can't find description of layer shapes HOT 3
- Talos installation stuck at downloading statsmodel HOT 1
- [RFC00102] Increase Visibility and Access to Power Draw Data HOT 1
- Getting errors when handling custom object HOT 4
- Add comprehensive support for n-dimensional `x` or `y`
- AttributeError: module 'talos.utils' has no attribute 'ExperimentLogCallback' HOT 1
- Live is not in talos HOT 1
- Advanced hyperparameter configuration HOT 1
- Error with Autom8 import HOT 1
- pip install talos is failing due to sklearn in requirements.txt instead of scikit-learn HOT 4
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 talos.