-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add random seed of training for reproducibility #51
base: master
Are you sure you want to change the base?
Conversation
For issue #50 |
Could you also change the generator-based approach? Specifically, there is a |
Sure, I will work on it. |
I don't think it's a good thing to do this (I mean add flag) , according to the comment here, by default Keras's model.compile() sets the shuffle argument as True. You should the set numpy seed before importing keras. Then, adding a flag would make code messy. |
Oh, I got it. However, I think it's two different things. Random seed for numpy and random seed for random. |
Already done (only one line code lol) |
I meant something like that SmilesDataGenerator.init could take a seed kwarg, which would be passed in at train_gen.py, using some sort of flag. In that case, it's ok to pass it in as acquired from a flag. Regarding train.py, you could move the keras import statements into the main function, with argparsing of whether there is a seed flag or not. Let's also pull the requirements commit out of this PR, and I'll accept it in the other PR. |
Is it ok? |
This way, someone can pass in the seed. This also moves the keras loading into main.
This way, someone can pass in the seed. This also moves the keras loading into main, and seeds the SmilesDataGenerator.
I've committed a couple changes to train and train_gen to take the seed as a cli parameter. Could you test that they work as you expect? |
I test using tensorflow backend, and I found it doesn't work. After a quick search of this, it seems still open issue. Besides, I failed to execute using theano backend. I am still checking what happened. |
Do you at least get consistent shuffling? Is it just the weight
initialization that is not seeded?
…On Fri, Dec 23, 2016 at 9:21 AM, hsiao yi ***@***.***> wrote:
I test using tensorflow backend, and I found it doesn't work. After a
quick search of this, it seems still open issue
<keras-team/keras#2280>. Besides, I failed to
execute using theano backend. I am still checking what happened.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFGDhjBjitQKZOHcEO4NUhnAhsVSS7-pks5rK9jSgaJpZM4LSxtK>
.
|
It looks like the |
I am still unable to execute the |
Oh, I find that I used wrong input file. The |
#2743 is still an issue for me, despite all the suggestions. Restarting the notebook gives different results as well. keras 2.0.2 |
It turns out that it is due to keras-team/keras#2280. I gave up trying these things long time ago. It seems that it can't be fixed in an easy manner. |
Thanks for the information. Non-reproducible results is a serious issue in keras imo. |
@@ -5,14 +5,11 @@ | |||
import h5py | |||
import numpy as np | |||
|
|||
from molecules.model import MoleculeVAE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't working for mw
As title