Skip to content

Fixed the random number generators.#83

Merged
nouiz merged 2 commits into
lisa-lab:masterfrom
caglar:master
May 11, 2015
Merged

Fixed the random number generators.#83
nouiz merged 2 commits into
lisa-lab:masterfrom
caglar:master

Conversation

@caglar
Copy link
Copy Markdown
Contributor

@caglar caglar commented May 11, 2015

Set default seed for all the random number generators in the LSTM code.

@nouiz
Copy link
Copy Markdown
Member

nouiz commented May 11, 2015

Thanks, the code also use the python random module, not just numpy random. Can you change the code to only use numpy random module? That could remove the not deterministic behavior you are seeing.

@caglar
Copy link
Copy Markdown
Contributor Author

caglar commented May 11, 2015

@nouiz thanks, it seems like you are right, mixing python number generator and numpy's seem to cause some non-deterministic behaviors. Changing python's random number generator to numpy's seem to fix the problem with this script.

@nouiz
Copy link
Copy Markdown
Member

nouiz commented May 11, 2015

The random come from the fac that they are independent rng. seeding python rng could have also fixed this. But I prefer to use only one if there isn't a good reason. I'll merge this PR when travis pass.

thanks

@caglar
Copy link
Copy Markdown
Contributor Author

caglar commented May 11, 2015

Hi @nouiz I was already seeding the python rng as well. That was the strange part.

@caglar
Copy link
Copy Markdown
Contributor Author

caglar commented May 11, 2015

Here is the line that I set the seed in my prev commit:
https://github.com/caglar/DeepLearningTutorials/blob/423f54d2daa67c02196737f17fc4365df6de76a1/code/lstm.py#L22

Anyways the tests are passing now.

nouiz added a commit that referenced this pull request May 11, 2015
Fixed the random number generators.
@nouiz nouiz merged commit 8131cd3 into lisa-lab:master May 11, 2015
taneishi pushed a commit to taneishi/DBN that referenced this pull request Nov 28, 2019
Fixed the random number generators.
taneishi pushed a commit to taneishi/DBN that referenced this pull request Feb 13, 2020
Fixed the random number generators.

Former-commit-id: ad9470f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants