Closed RoyStegeman closed 4 years ago
I just tried running this in n3fit
and seems to work ok (yey!) and the chi2 goes down.
It is much slower but this is expected (and don't really now whether it can be improved, but we can try)
Yes that was to be expected. I have not had a look at Hansen's source code, but CMA is based on matrix manupulation, which I believe python is not too well suited for. Also, the n3fit
network is somewhat large for using CMA anyway, but there is nothing we can do about that.
I just tried running this in n3fit and seems to work ok (yey!)
Thanks for testing, I had not run it in n3fit yet myself. Good to know it did not bump into any unforeseen errors.
@scarlehoff I would like to merge this. Can you have a look?
@scarlehoff Thank you for the many comments. I implemented all of them.
This is the version you used for the last report in NNPDF right?
I'll change the setup.py
and the conda recipe and then I'll merge this in if that's ok.
Yes but let me check, I think there are some things that I should adjust for more general use.
ok, no rush, we can safely wait until the proceedings are published.
Okay, this should do. Feel free to merge after you made the changes to setup.py
.
I think this should do, as far as making evolutionary-keras
future proof is concerned. Pylint does give import errors, but I think that's a problem in pylint. Can you have a look at this error and the setup.py @scarlehoff ?
This last part was better suited on a different branch (on a different PR) which can point to this one.
You want me to move them to a separate branch before you have a look?
You want me to move them to a separate branch before you have a look?
Yes please, also because I think we want to wait for Tensorflow 2.2 https://github.com/tensorflow/tensorflow/releases/tag/v2.2.0-rc3 because they have changed the metrics in the tensorflow.keras
module which can interfere with evolutionary_keras
.
I'll merge this as soon as the tests pass
Sure, thanks for checking the PRs.
I added a first version of a CMA-ES optimizer in keras as suggested in #16 , but some work is still to be done:
add commentsmake it so it only changes trainable layerscma decides on number of generations, hence epochs=1. So we should do something to createhistory
The optimizer used is https://pypi.org/project/cma/ by Nikolaus.Hansen, which (according to himself) is supposed to be more efficient than the relatively simple implementation discussed in his papers.