Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc for gru_unit op (in fluid) #7151

Merged
merged 7 commits into from
Jan 4, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove cdot which isn't supported
  • Loading branch information
sidgoyal78 committed Jan 2, 2018
commit 9cc96dadfd7ecc8ed58165aa843a1e2ddb1bd99c
6 changes: 3 additions & 3 deletions python/paddle/v2/fluid/layers/nn.py
Original file line number Diff line number Diff line change
@@ -243,17 +243,17 @@ def gru_unit(input,

r_t & = actGate(xr_{t} + W_r h_{t-1} + b_r)

ch_t & = actNode(xc_t + W_c \cdot(r_t, h_{t-1}) + b_c)
ch_t & = actNode(xc_t + W_c dot(r_t, h_{t-1}) + b_c)

h_t & = \cdot((1-u_t), ch_{t-1}) + \cdot(u_t, h_t)
h_t & = dot((1-u_t), ch_{t-1}) + dot(u_t, h_t)

The inputs of gru unit includes :math:`z_t`, :math:`h_{t-1}`. In terms
of the equation above, the :math:`z_t` is split into 3 parts -
:math:`xu_t`, :math:`xr_t` and :math:`xc_t`. This means that in order to
implement a full GRU unit operator for an input, a fully
connected layer has to be applied, such that :math:`z_t = W_{fc}x_t`.

This layer has three outputs :math:`h_t`, :math:`\cdot(r_t, h_{t - 1})`
This layer has three outputs :math:`h_t`, :math:`dot(r_t, h_{t - 1})`
and concatenation of :math:`u_t`, :math:`r_t` and :math:`ch_t`.

Args: