MCPcopy Create free account
hub / github.com/apache/singa / forward

Method forward

python/singa/autograd.py:2891–2901  ·  view source on GitHub ↗

Return `(x/(1+|x|))`, where x is CTensor.

(self, x)

Source from the content-addressed store, hash-verified

2889 super(SoftSign, self).__init__()
2890
2891 def forward(self, x):
2892 """
2893 Return `(x/(1+|x|))`, where x is CTensor.
2894 """
2895 # y = x / (1 + np.abs(x))
2896 if training:
2897 self.input = x
2898 x1 = singa.AddFloat(singa.Abs(x), 1.0)
2899 y = singa.__div__(x, x1)
2900
2901 return y
2902
2903 def backward(self, dy):
2904 """

Callers

nothing calls this directly

Calls 1

__div__Method · 0.45

Tested by

no test coverage detected