MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / LSTMCell

Method LSTMCell

tensorflow/python/framework/function_test.py:1504–1512  ·  view source on GitHub ↗
(cls, x, mprev, cprev, weights)

Source from the content-addressed store, hash-verified

1502 # Helper to construct a LSTM cell graph.
1503 @classmethod
1504 def LSTMCell(cls, x, mprev, cprev, weights):
1505 xm = array_ops.concat([x, mprev], 1)
1506 i_i, i_g, f_g, o_g = array_ops.split(
1507 value=math_ops.matmul(xm, weights), num_or_size_splits=4, axis=1)
1508 new_c = math_ops.sigmoid(f_g) * cprev + math_ops.sigmoid(
1509 i_g) * math_ops.tanh(i_i)
1510 new_c = math_ops.maximum(math_ops.minimum(new_c, 50.0), -50.0)
1511 new_m = math_ops.sigmoid(o_g) * math_ops.tanh(new_c)
1512 return new_m, new_c
1513
1514 def _BuildForward(self, weights, inp, mode="cell"):
1515

Callers 15

_CreateStackedLstmCellFunction · 0.80
cell_fnMethod · 0.80
cell_fnMethod · 0.80
cell_fnMethod · 0.80
_testDynamicDecodeRNNMethod · 0.80
testLuongScaledDTypeMethod · 0.80
_testDynamicDecodeRNNMethod · 0.80
_testDynamicDecodeRNNMethod · 0.80

Calls 5

maximumMethod · 0.80
minimumMethod · 0.80
concatMethod · 0.45
splitMethod · 0.45
matmulMethod · 0.45

Tested by

no test coverage detected