tf.raw_ops.LSTMBlockCell
Stay organized with collections
Save and categorize content based on your preferences.
Computes the LSTM cell forward propagation for 1 time step.
tf.raw_ops.LSTMBlockCell(
x,
cs_prev,
h_prev,
w,
wci,
wcf,
wco,
b,
forget_bias=1,
cell_clip=3,
use_peephole=False,
name=None
)
This implementation uses 1 weight matrix and 1 bias vector, and there's an
optional peephole connection.
This kernel op implements the following mathematical equations:
xh = [x, h_prev]
[i, f, ci, o] = xh * w + b
f = f + forget_bias
if not use_peephole:
wci = wcf = wco = 0
i = sigmoid(cs_prev * wci + i)
f = sigmoid(cs_prev * wcf + f)
ci = tanh(ci)
cs = ci .* i + cs_prev .* f
cs = clip(cs, cell_clip)
o = sigmoid(cs * wco + o)
co = tanh(cs)
h = co .* o
Args |
x
|
A Tensor . Must be one of the following types: half , float32 .
The input to the LSTM cell, shape (batch_size, num_inputs).
|
cs_prev
|
A Tensor . Must have the same type as x .
Value of the cell state at previous time step.
|
h_prev
|
A Tensor . Must have the same type as x .
Output of the previous cell at previous time step.
|
w
|
A Tensor . Must have the same type as x . The weight matrix.
|
wci
|
A Tensor . Must have the same type as x .
The weight matrix for input gate peephole connection.
|
wcf
|
A Tensor . Must have the same type as x .
The weight matrix for forget gate peephole connection.
|
wco
|
A Tensor . Must have the same type as x .
The weight matrix for output gate peephole connection.
|
b
|
A Tensor . Must have the same type as x . The bias vector.
|
forget_bias
|
An optional float . Defaults to 1 . The forget gate bias.
|
cell_clip
|
An optional float . Defaults to 3 .
Value to clip the 'cs' value to.
|
use_peephole
|
An optional bool . Defaults to False .
Whether to use peephole weights.
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (i, cs, f, o, ci, co, h).
|
i
|
A Tensor . Has the same type as x .
|
cs
|
A Tensor . Has the same type as x .
|
f
|
A Tensor . Has the same type as x .
|
o
|
A Tensor . Has the same type as x .
|
ci
|
A Tensor . Has the same type as x .
|
co
|
A Tensor . Has the same type as x .
|
h
|
A Tensor . Has the same type as x .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2022-10-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-10-28 UTC."],[],[]]