25694a657492c97276d201a98cff47266060254a,paysage/layers.py,BernoulliLayer,sample_state,#BernoulliLayer#Any#,71
Before Change
return B.softplus(loc)
def sample_state(self, loc):
return B.random_bernoulli(B.expit(loc))
def random(self, loc):
return numpy.random.randint(0, 2, loc.shape).astype(numpy.float32)
After Change
def sample_state(self, loc):
p = B.expit(loc)
r = self.rand.get(*p.shape)
while r.shape != p.shape:
r = self.rand.get(*p.shape)
return numpy.float32(r<p)
def random(self, loc):
r = self.rand.get(*loc.shape)
while r.shape != loc.shape:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 15
Instances
Project Name: drckf/paysage
Commit Name: 25694a657492c97276d201a98cff47266060254a
Time: 2016-12-23
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/layers.py
Class Name: BernoulliLayer
Method Name: sample_state
Project Name: drckf/paysage
Commit Name: 25694a657492c97276d201a98cff47266060254a
Time: 2016-12-23
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/layers.py
Class Name: IsingLayer
Method Name: sample_state
Project Name: drckf/paysage
Commit Name: 25694a657492c97276d201a98cff47266060254a
Time: 2016-12-23
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/layers.py
Class Name: BernoulliLayer
Method Name: random