9962067e1b9886c546abc0af8d4d00fc31cab1ef,paysage/layers.py,IsingLayer,online_param_update,#IsingLayer#Any#,802

Before Change



        
        // get the current value of the first moment
        x = be.tanh(self.params.loc)

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

        // updat 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.params = ParamsIsing(be.atanh(x))
        self.sample_size = new_sample_size

    def shrink_parameters(self, shrinkage=1):
        
        Apply shrinkage to the parameters of the layer.

After Change


            None

        
        self.mean_calc.update(data)
        self.sample_size = self.mean_calc.num
        self.params = ParamsIsing(be.atanh(self.mean_calc.mean))

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

Frequency: 3

Non-data size: 21

Instances


Project Name: drckf/paysage
Commit Name: 9962067e1b9886c546abc0af8d4d00fc31cab1ef
Time: 2017-05-19
Author: jrwalsh1@gmail.com
File Name: paysage/layers.py
Class Name: IsingLayer
Method Name: online_param_update


Project Name: drckf/paysage
Commit Name: 9962067e1b9886c546abc0af8d4d00fc31cab1ef
Time: 2017-05-19
Author: jrwalsh1@gmail.com
File Name: paysage/layers.py
Class Name: ExponentialLayer
Method Name: online_param_update


Project Name: drckf/paysage
Commit Name: 9962067e1b9886c546abc0af8d4d00fc31cab1ef
Time: 2017-05-19
Author: jrwalsh1@gmail.com
File Name: paysage/layers.py
Class Name: BernoulliLayer
Method Name: online_param_update


Project Name: drckf/paysage
Commit Name: 9962067e1b9886c546abc0af8d4d00fc31cab1ef
Time: 2017-05-19
Author: jrwalsh1@gmail.com
File Name: paysage/layers.py
Class Name: IsingLayer
Method Name: online_param_update