1624bfcb02cd3e946552490ab18130678aa433b1,paysage/models/model.py,Model,grad_TAP_free_energy,#Model#,705

Before Change


        

        // compute the TAP approximation to the Helmholtz free energy:
        grad_EMF = gu.zero_grad(self)

        // compute minimizing magnetizations from random initializations
        for s in range(num_r):
            mag, EMF = self.TAP_free_energy(None,
                                            init_lr_EMF,
                                            tolerance_EMF,
                                            max_iters_EMF)
            // Compute the gradients at this minimizing magnetization
            grad_gfe = self._grad_gibbs_free_energy(mag)
            gu.grad_mapzip_(be.add_, grad_gfe, grad_EMF)

        // average
        scale = partial(be.tmul_, be.float_scalar(1/num_r))
        gu.grad_apply_(scale, grad_EMF)

        return grad_EMF

    def save(self, store: pandas.HDFStore) -> None:
        
        Save a model to an open HDFStore.

After Change


                                          max_iters_EMF)

        // Return the gradients at this minimizing magnetization
        return self._grad_gibbs_free_energy(mag)

    def save(self, store: pandas.HDFStore) -> None:
        
        Save a model to an open HDFStore.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 20

Instances


Project Name: drckf/paysage
Commit Name: 1624bfcb02cd3e946552490ab18130678aa433b1
Time: 2017-05-18
Author: geminatea@gmail.com
File Name: paysage/models/model.py
Class Name: Model
Method Name: grad_TAP_free_energy


Project Name: drckf/paysage
Commit Name: 93418122381378d6a812287e6507ed1889fecda8
Time: 2017-05-18
Author: geminatea@gmail.com
File Name: paysage/models/model.py
Class Name: Model
Method Name: grad_TAP_free_energy


Project Name: drckf/paysage
Commit Name: 81933a874f108043a25f6980334f7242147ddf59
Time: 2017-05-18
Author: charleskennethfisher@gmail.com
File Name: paysage/models/model.py
Class Name: Model
Method Name: grad_TAP_free_energy