41bd741fef07076d854bb164b5df764e9fcc6a2a,paysage/models/tap_machine.py,TAP_rbm,gradient,#TAP_rbm#Any#Any#,206

Before Change


        //TODO: vectorize
        for v in vdata:
            //score -= self.marginal_free_energy(v)
            dw += be.outer(v,be.expit(be.dot(v,w) + b))
            da += v
            db += be.expit(b + be.dot(v,w))

        grad = gu.Gradient(

After Change


        batch_size = be.shape(vdata)[0]
        // This is the same as \sum_{i} vdata[i] \outer intermediate[i]
        // TODO: is this efficient?
        dw = be.dot(be.transpose(vdata), intermediate) / batch_size

        grad = gu.Gradient(
            [None for l in self.layers],
            [None for w in self.weights]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: drckf/paysage
Commit Name: 41bd741fef07076d854bb164b5df764e9fcc6a2a
Time: 2017-04-17
Author: geminatea@gmail.com
File Name: paysage/models/tap_machine.py
Class Name: TAP_rbm
Method Name: gradient


Project Name: drckf/paysage
Commit Name: 7b48b0899970079383ae52ffcd60e1320c60c571
Time: 2016-12-21
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/models/hidden.py
Class Name: RestrictedBoltzmannMachine
Method Name: derivatives


Project Name: drckf/paysage
Commit Name: f5dc304efb564893f548a4d2d09d36ac3047987e
Time: 2016-12-25
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/models/hidden.py
Class Name: GaussianRestrictedBoltzmannMachine
Method Name: derivatives