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

Class Exp

python/singa/autograd.py:2699–2721  ·  view source on GitHub ↗

`y = exp(x)`, is applied to the tensor elementwise.

Source from the content-addressed store, hash-verified

2697
2698
2699class Exp(Operator):
2700 """
2701 `y = exp(x)`, is applied to the tensor elementwise.
2702 """
2703
2704 def forward(self, a):
2705 """
2706 Return `exp(a)`, where a is Tensor.
2707 """
2708 if training:
2709 self.input = a
2710 return singa.Exp(a)
2711
2712 def backward(self, dy):
2713 """
2714 Args:
2715 dy (CTensor): the gradient tensor from upper operations
2716 Returns:
2717 CTensor, the gradient over input
2718 """
2719 dx = singa.Exp(self.input)
2720 dx *= dy
2721 return dx
2722
2723
2724def exp(a):

Callers 3

expFunction · 0.70
TEST_FFunction · 0.50
TEST_FFunction · 0.50

Calls

no outgoing calls

Tested by 2

TEST_FFunction · 0.40
TEST_FFunction · 0.40