c9ad3a0a85bdb5e340cd9f40d0be98b768e1d401,thinc/backends/ops.py,Ops,mish,#Ops#Any#Any#Any#,469

Before Change


    def mish(
        self, X: Array2d, threshold: float = 20.0, out: Optional[Array2d] = None
    ) -> Array2d:
        Xsoft = self.softplus(X, threshold=threshold, out=out)
        Y = self.xp.tanh(Xsoft, out=out)
        Y *= X
        return Y

After Change


        tmp = X * self.xp.tanh(self.xp.log(1. + self.xp.exp(X)))
        for i in range(X.shape[0]):
            for j in range(X.shape[1]):
                if X[i, j] >= threshold:
                    Y[i, j] = X[i, j]
                else:
                    Y[i, j] = tmp[i, j]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: explosion/thinc
Commit Name: c9ad3a0a85bdb5e340cd9f40d0be98b768e1d401
Time: 2020-01-16
Author: honnibal+gh@gmail.com
File Name: thinc/backends/ops.py
Class Name: Ops
Method Name: mish


Project Name: arnomoonens/yarll
Commit Name: b559f5b97f4227c4f6f7daf4a725a1e0c71c47a2
Time: 2017-10-18
Author: x-006@hotmail.com
File Name: agents/reinforce.py
Class Name: REINFORCEContinuous
Method Name: build_network_rnn


Project Name: arnomoonens/yarll
Commit Name: b559f5b97f4227c4f6f7daf4a725a1e0c71c47a2
Time: 2017-10-18
Author: x-006@hotmail.com
File Name: agents/reinforce.py
Class Name: REINFORCEContinuous
Method Name: build_network_normal