7da71b22f18f5d02ca57a8e5cb5ae47338ae8a31,qucumber/rbm/purification_rbm.py,PurificationRBM,gamma_plus,#PurificationRBM#,344

Before Change


                  :math:`\langle\sigma|\Gamma^{(+)}|\sigma"\rangle`
        :rtype: torch.Tensor
        
        if len(v.shape) < 2 and len(vp.shape) < 2:
            temp = torch.dot(v + vp, self.visible_bias)
            temp += F.softplus(F.linear(v, self.weights_W, self.hidden_bias)).sum()
            temp += F.softplus(F.linear(vp, self.weights_W, self.hidden_bias)).sum()
        else:
            temp = torch.mv(v, self.visible_bias).unsqueeze_(1) + torch.mv(
                vp, self.visible_bias
            ).unsqueeze_(0)

            temp += (
                F.softplus(F.linear(v, self.weights_W, self.hidden_bias))
                .sum(1)

After Change


                  :math:`\langle\sigma|\Gamma^{(+)}|\sigma"\rangle`
        :rtype: torch.Tensor
        
        if v.dim() < 2 and vp.dim() < 2:
            temp = torch.dot(v + vp, self.visible_bias)
            temp += F.softplus(F.linear(v, self.weights_W, self.hidden_bias)).sum()
            temp += F.softplus(F.linear(vp, self.weights_W, self.hidden_bias)).sum()
        else:
            temp1 = torch.mv(v, self.visible_bias) + (
                F.softplus(F.linear(v, self.weights_W, self.hidden_bias)).sum(1)
            )

            temp2 = torch.mv(vp, self.visible_bias) + (
                F.softplus(F.linear(vp, self.weights_W, self.hidden_bias)).sum(1)
            )

            if expand:
                temp = temp1.unsqueeze_(1) + temp2.unsqueeze_(0)
            else:
                temp = temp1 + temp2

        return 0.5 * temp

    def gamma_minus(self, v, vp, expand=True):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: PIQuIL/QuCumber
Commit Name: 7da71b22f18f5d02ca57a8e5cb5ae47338ae8a31
Time: 2019-12-19
Author: emerali@users.noreply.github.com
File Name: qucumber/rbm/purification_rbm.py
Class Name: PurificationRBM
Method Name: gamma_plus


Project Name: mariogeiger/se3cnn
Commit Name: 9c309a959052ec40cf92cf4baa3894f5118cf8c4
Time: 2019-07-08
Author: geiger.mario@gmail.com
File Name: se3cnn/blocks/point_gated_block.py
Class Name: PointGatedBlock
Method Name: forward


Project Name: Scitator/catalyst
Commit Name: e839626c28d8dc6030ce71f3619e934b36fb6627
Time: 2020-10-23
Author: Balaganskij.NN@phystech.edu
File Name: catalyst/metrics/functional.py
Class Name:
Method Name: process_multiclass_components