cd18ca2e192758543a46851be41f8e0ca1c60851,paysage/layers.py,IsingLayer,derivatives,#IsingLayer#Any#Any#Any#Any#,827

Before Change


            grad (dict): {param_name: tensor (contains gradient)}

        
        derivs = {
        "loc": be.zeros(self.len)
        }

        derivs["loc"] = -be.mean(vis, axis=0)
        be.add_dicts_inplace(derivs, self.get_penalty_gradients())

        return derivs

    def rescale(self, observations):
        
        Rescale is equivalent to the identity function for the Ising layer.

After Change


        field += be.broadcast(self.int_params.loc, field)
        self.ext_params = IsingLayer.IntrinsicParams(field)

    def derivatives(self, vis, hid, weights, beta=None):
        
        Compute the derivatives of the intrinsic layer parameters.

        Args:
            vis (tensor (num_samples, num_units)):
                The values of the visible units.
            hid list[tensor (num_samples, num_connected_units)]:
                The rescaled values of the hidden units.
            weights list[tensor, (num_units, num_connected_units)]:
                The weights connecting the layers.
            beta (tensor (num_samples, 1), optional):
                Inverse temperatures.

        Returns:
            grad (namedtuple): param_name: tensor (contains gradient)

        
        loc = -be.mean(vis, axis=0)
        loc = self.get_penalty_grad(loc, "loc")
        return IsingLayer.IntrinsicParams(loc)

    def rescale(self, observations):
        
        Rescale is equivalent to the identity function for the Ising layer.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


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


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


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