Warning: This API is deprecated and will be removed in a future
version of TensorFlow after
the replacement is stable.
GRUBlockCell
Stay organized with collections
Save and categorize content based on your preferences.
Computes the GRU cell forward propagation for 1 time step.
Args
x: Input to the GRU cell.
h_prev: State input from the previous GRU cell.
w_ru: Weight matrix for the reset and update gate.
w_c: Weight matrix for the cell connection gate.
b_ru: Bias vector for the reset and update gate.
b_c: Bias vector for the cell connection gate.
Returns
r: Output of the reset gate.
u: Output of the update gate.
c: Output of the cell connection gate.
h: Current state of the GRU cell.
Note on notation of the variables:
Concatenation of a and b is represented by a_b
Element-wise dot product of a and b is represented by ab
Element-wise dot product is represented by \circ
Matrix multiplication is represented by *
Biases are initialized with :
`b_ru` - constant_initializer(1.0)
`b_c` - constant_initializer(0.0)
This kernel op implements the following mathematical equations:
x_h_prev = [x, h_prev]
[r_bar u_bar] = x_h_prev * w_ru + b_ru
r = sigmoid(r_bar)
u = sigmoid(u_bar)
h_prevr = h_prev \circ r
x_h_prevr = [x h_prevr]
c_bar = x_h_prevr * w_c + b_c
c = tanh(c_bar)
h = (1-u) \circ c + u \circ h_prev
Inherited Methods
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Public Methods
Factory method to create a class wrapping a new GRUBlockCell operation.
Returns
- a new instance of GRUBlockCell
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.
Last updated 2022-02-12 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-02-12 UTC."],[],[],null,["# GRUBlockCell\n\npublic final class **GRUBlockCell** \nComputes the GRU cell forward propagation for 1 time step.\n\n\nArgs\nx: Input to the GRU cell.\nh_prev: State input from the previous GRU cell.\nw_ru: Weight matrix for the reset and update gate.\nw_c: Weight matrix for the cell connection gate.\nb_ru: Bias vector for the reset and update gate.\nb_c: Bias vector for the cell connection gate.\n\n\nReturns\nr: Output of the reset gate.\nu: Output of the update gate.\nc: Output of the cell connection gate.\nh: Current state of the GRU cell.\n\n\nNote on notation of the variables:\n\n\nConcatenation of a and b is represented by a_b\nElement-wise dot product of a and b is represented by ab\nElement-wise dot product is represented by \\\\circ\nMatrix multiplication is represented by \\*\n\n\nBiases are initialized with :\n\\`b_ru\\` - constant_initializer(1.0)\n\\`b_c\\` - constant_initializer(0.0)\n\n\nThis kernel op implements the following mathematical equations: \n\n x_h_prev = [x, h_prev]\n \n [r_bar u_bar] = x_h_prev * w_ru + b_ru\n \n r = sigmoid(r_bar)\n u = sigmoid(u_bar)\n \n h_prevr = h_prev \\circ r\n \n x_h_prevr = [x h_prevr]\n \n c_bar = x_h_prevr * w_c + b_c\n c = tanh(c_bar)\n \n h = (1-u) \\circ c + u \\circ h_prev\n \n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Public Methods\n\n|-----------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [c](/api_docs/java/org/tensorflow/op/core/GRUBlockCell#c())() |\n| static \\\u003cT extends Number\\\u003e [GRUBlockCell](/api_docs/java/org/tensorflow/op/core/GRUBlockCell)\\\u003cT\\\u003e | [create](/api_docs/java/org/tensorflow/op/core/GRUBlockCell#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand\u003cT\u003e,%20org.tensorflow.Operand\u003cT\u003e,%20org.tensorflow.Operand\u003cT\u003e,%20org.tensorflow.Operand\u003cT\u003e,%20org.tensorflow.Operand\u003cT\u003e,%20org.tensorflow.Operand\u003cT\u003e))([Scope](/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e x, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e hPrev, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e wRu, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e wC, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e bRu, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e bC) Factory method to create a class wrapping a new GRUBlockCell operation. |\n| [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [h](/api_docs/java/org/tensorflow/op/core/GRUBlockCell#h())() |\n| [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [r](/api_docs/java/org/tensorflow/op/core/GRUBlockCell#r())() |\n| [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [u](/api_docs/java/org/tensorflow/op/core/GRUBlockCell#u())() |\n\n### Inherited Methods\n\nFrom class [org.tensorflow.op.PrimitiveOp](/api_docs/java/org/tensorflow/op/PrimitiveOp) \n\n|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| final boolean | [equals](/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |\n| final int | [hashCode](/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |\n| [Operation](/api_docs/java/org/tensorflow/Operation) | [op](/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying [Operation](/api_docs/java/org/tensorflow/Operation) |\n| final String | [toString](/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e\n**c**\n()\n\n\u003cbr /\u003e\n\n#### public static [GRUBlockCell](/api_docs/java/org/tensorflow/op/core/GRUBlockCell)\\\u003cT\\\u003e\n**create**\n([Scope](/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e x, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e hPrev, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e wRu, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e wC, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e bRu, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e bC)\n\nFactory method to create a class wrapping a new GRUBlockCell operation. \n\n##### Parameters\n\n| scope | current scope |\n|-------|---------------|\n\n##### Returns\n\n- a new instance of GRUBlockCell \n\n#### public [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e\n**h**\n()\n\n\u003cbr /\u003e\n\n#### public [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e\n**r**\n()\n\n\u003cbr /\u003e\n\n#### public [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e\n**u**\n()\n\n\u003cbr /\u003e"]]