Merged
Conversation
Member
There was a problem hiding this comment.
This should be Dtype and not double, no? Otherwise this looks good.
Contributor
Author
There was a problem hiding this comment.
Nope, this was the point of the PR - the only Dtype Caffe actually instantiates for caffe_vRngBernoulli is int (as Bernoulli outputs 0/1), and when you use bernoulli_distribution it seems to typecast p to an int (setting the Bernoulli parameter to 0.0 for p in [0, 1)) and output all zeros (unless p==1.0).
Member
There was a problem hiding this comment.
Oh right, I forgot you told me that yesterday.
shelhamer
added a commit
that referenced
this pull request
Jan 30, 2014
fix bernoulli random number generation
Closed
happynear
pushed a commit
to happynear/caffe
that referenced
this pull request
May 12, 2016
…4_04
Merge bvlc/window@{2016-04-04} into master
naibaf7
added a commit
that referenced
this pull request
Apr 18, 2017
Exclude HDF5-specific code when not supported
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Bernoulli RNG bug and add test case - was previously generating all 0s unless p==1 exactly. Not entirely sure why boost::bernoulli_distribution doesn't work - perhaps it typecasts p to an int, thereby truncating anything in [0,1) to 0?