Keras regressor integration issues #85
Comments
|
Hi! You need to use the scikit-learn wrapper for Keras. If the Keras built-in scikit-learn wrapper works with the regressor, it should work in modAL. Let me know if there are any issues! |
|
Hi, thank you for your reply! Yes I am using KerasRegressor from the scikit-learn wrapper for Keras. In the initialisation of the active learner step with the estimator set as the regressor, it works fine and the model is successfully fitted for the initial data. But upon running the active learning loop, it throws the error mentioned above. |
|
Come to think of it, a neural network based regressor may not have a way to estimate the prediction probabilities, hence no Here is an implementation in Keras: https://gdmarmerola.github.io/risk-and-uncertainty-deep-learning/ |
|
Ooh, wow thanks a lot for your help! For my regression model, I am trying to implement bayesian optimization with max EI as query strategy for active learning. With what you mentioned, I would have to implement AL from scratch with inspiration from your modAL package instead of plugging from your current packages? |
|
You can definitely use modAL. You just need to implement a |
|
Hi, thanks a lot for your help previously. I went back and tried using Bayesian optimizer with query strategy of max Expected Improvement based on prediction values and their uncertainties but I have some questions.
Thank you very much for your time! |
|
In general, Bayesian optimization is done with using a Gaussian process to model your quantity, so this is what the Regarding 2. and 3.: In principle, you can do this with a neural network as well. In this case, the mean and std of the predictions can be obtained by adding dropout and generating a bunch of predictions as you did. The mean and std of these will work, but I am unaware of how they perform in practice. If your EI is small, it means that your estimator thinks you probably won't improve by evaluating the function at other points. Regarding 4.: I can refer this excellent review: https://www.cs.ox.ac.uk/people/nando.defreitas/publications/BayesOptLoop.pdf |
After initializing a keras model:
And using the KerasRegressor from keras sklearn wrapper, initializing the ActiveLearner has no issues and the initial metrics can be evaluated:
However, the active learning loop below throws an error of
Does modAL work with KerasRegressor?
Many thanks!
The text was updated successfully, but these errors were encountered: