980bd9d5c003b0bf3db34126bb19657cdd3f0be5,paysage/layers.py,BernoulliLayer,online_param_update,#BernoulliLayer#Any#,1034

Before Change


        n = len(data)
        new_sample_size = n + self.sample_size
        // update the first moment
        x = be.expit(self.int_params["loc"])
        x *= self.sample_size / new_sample_size
        x += n * be.mean(data, axis=0) / new_sample_size
        // update the location parameter
        self.int_params["loc"] = be.logit(x)
        // update the sample size
        self.sample_size = new_sample_size

After Change



        
        // get the current value of the first moment
        x = be.expit(self.int_params["loc"])

        // update the sample size
        n = len(data)
        new_sample_size = n + self.sample_size

        // update the first moment
        x *= self.sample_size / new_sample_size
        x += n * be.mean(data, axis=0) / new_sample_size

        // update the class attributes
        self.int_params = BernoulliLayer.IntrinsicParams(be.logit(x))
        self.sample_size = new_sample_size

    def shrink_parameters(self, shrinkage=1):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: drckf/paysage
Commit Name: 980bd9d5c003b0bf3db34126bb19657cdd3f0be5
Time: 2017-03-31
Author: charleskennethfisher@gmail.com
File Name: paysage/layers.py
Class Name: BernoulliLayer
Method Name: online_param_update


Project Name: drckf/paysage
Commit Name: 1184f7dd9e9970620f09d27445c80fd08efcfea6
Time: 2017-03-31
Author: charleskennethfisher@gmail.com
File Name: paysage/layers.py
Class Name: IsingLayer
Method Name: online_param_update


Project Name: drckf/paysage
Commit Name: b326b8034d5e8973c8aa9fbb5427d23963a430f8
Time: 2017-03-31
Author: charleskennethfisher@gmail.com
File Name: paysage/layers.py
Class Name: ExponentialLayer
Method Name: online_param_update