Skip to content

Comments

Bernoullirngbugfix#63

Merged
shelhamer merged 2 commits intoBVLC:boost-eigenfrom
jeffdonahue:bernoullirngbugfix
Jan 30, 2014
Merged

Bernoullirngbugfix#63
shelhamer merged 2 commits intoBVLC:boost-eigenfrom
jeffdonahue:bernoullirngbugfix

Conversation

@jeffdonahue
Copy link
Contributor

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be Dtype and not double, no? Otherwise this looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@shelhamer shelhamer merged commit ca1c462 into BVLC:boost-eigen Jan 30, 2014
@jeffdonahue jeffdonahue deleted the bernoullirngbugfix branch February 4, 2014 20:39
@jeffdonahue jeffdonahue restored the bernoullirngbugfix branch February 4, 2014 21:22
@jeffdonahue jeffdonahue deleted the bernoullirngbugfix branch February 5, 2014 21:33
@jeffdonahue jeffdonahue restored the bernoullirngbugfix branch February 6, 2014 09:52
@jeffdonahue jeffdonahue deleted the bernoullirngbugfix branch September 7, 2014 13:11
@dsmic dsmic mentioned this pull request Dec 25, 2014
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants