25694a657492c97276d201a98cff47266060254a,paysage/layers.py,GaussianLayer,sample_state,#GaussianLayer#Any#Any#,23

Before Change


        return -B.log(scale)
    
    def sample_state(self, loc, scale):
        return loc + scale * numpy.random.normal(loc=0.0, scale=1.0, size=loc.shape).astype(numpy.float32)
        
    def random(self, loc, scale):
        return numpy.random.normal(loc=0.0, scale=1.0, size=loc.shape).astype(numpy.float32)

After Change


        return -B.log(scale)
    
    def sample_state(self, loc, scale):
        r = self.rand.get(*loc.shape)        
        while r.shape != loc.shape:
            r = self.rand.get(*loc.shape)
        return loc + scale * r
        
    def random(self, loc, scale):
        r = self.rand.get(*loc.shape)        
        while r.shape != loc.shape:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: GaussianLayer
Method Name: sample_state


Project Name: d2l-ai/d2l-zh
Commit Name: ef784a5b9046b1861de9d7ebba06e2d51a87c0cd
Time: 2018-08-28
Author: muli@cs.cmu.edu
File Name: gluonbook/utils.py
Class Name:
Method Name: get_data_ch7


Project Name: drckf/paysage
Commit Name: 25694a657492c97276d201a98cff47266060254a
Time: 2016-12-23
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/layers.py
Class Name: GaussianLayer
Method Name: random