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

Method step_forward

python/singa/layer.py:1203–1214  ·  view source on GitHub ↗
(self, x, h, Wx, Wh, b)

Source from the content-addressed store, hash-verified

1201 return out, h
1202
1203 def step_forward(self, x, h, Wx, Wh, b):
1204 y2 = autograd.matmul(h, Wh)
1205 y1 = autograd.matmul(x, Wx)
1206 y = autograd.add(y2, y1)
1207 y = autograd.add_bias(y, b, axis=0)
1208 if self.nonlinearity == "tanh":
1209 y = autograd.tanh(y)
1210 elif self.nonlinearity == "relu":
1211 y = autograd.relu(y)
1212 else:
1213 raise ValueError
1214 return y
1215
1216 def get_params(self):
1217 return {

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected