Skip to content

Commit

Permalink
RNN
Browse files Browse the repository at this point in the history
  • Loading branch information
pchavanne committed Jan 28, 2017
1 parent 0760f89 commit cb31894
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions yadll/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ class BatchNormalization(Layer):
Normalize the input layer over each mini-batch according to [1]_:
.. math::
\hat{x} = \frac{x - E[x]}{\sqrt(Var[x] + \epsilon)}
\hat{x} = \frac{x - E[x]}{\sqrt{Var[x] + \epsilon}}
y = \gamma * \hat{x} + \beta
Expand Down Expand Up @@ -696,27 +696,27 @@ class LSTM(Layer):
Long Short Term Memory
.. math ::
i_t &= \sigma(x_t.W_i + h_{t-1}.U_i + b_i) & \texte{Input gate}\\
f_t &= \sigma(x_t.W_f + h_{t-1}.U_f + b_f) & \texte{Forget gate}\\
\tilde{C_t} &= \tanh(x_t.W_c + h_{t-1}.U_c + b_c) & \texte{Cell gate}\\
C_t &= f_t * C_{t-1} + i_t * \tilde{C_t} & \texte{Cell state}\\
o_t &= \sigma(x_t.W_o + h_{t-1}.U_o + b_o) & \texte{Output gate}\\
h_t &= o_t * \tanh(C_t) & \texte{Hidden state}\\
i_t &= \sigma(x_t.W_i + h_{t-1}.U_i + b_i) & \text{Input gate}\\
f_t &= \sigma(x_t.W_f + h_{t-1}.U_f + b_f) & \text{Forget gate}\\
\tilde{C_t} &= \tanh(x_t.W_c + h_{t-1}.U_c + b_c) & \text{Cell gate}\\
C_t &= f_t * C_{t-1} + i_t * \tilde{C_t} & \text{Cell state}\\
o_t &= \sigma(x_t.W_o + h_{t-1}.U_o + b_o) & \text{Output gate}\\
h_t &= o_t * \tanh(C_t) & \text{Hidden state}\\
with Peephole connections:
.. math ::
i_t &= \sigma(x_t.W_i + h_{t-1}.U_i + C_{t-1}.P_i + b_i) & \texte{Input gate}\\
f_t &= \sigma(x_t.W_f + h_{t-1}.U_f + C_{t-1}.P_f + b_f) & \texte{Forget gate}\\
\tilde{C_t} &= \tanh(x_t.W_c + h_{t-1}.U_c + b_c) & \texte{Cell gate}\\
C_t &= f_t * C_{t-1} + i_t * \tilde{C_t} & \texte{Cell state}\\
o_t &= \sigma(x_t.W_o + h_{t-1}.U_o + C_t.P_o + b_o) & \texte{Output gate}\\
h_t &= o_t * \tanh(C_t) & \texte{Hidden state}\\
i_t &= \sigma(x_t.W_i + h_{t-1}.U_i + C_{t-1}.P_i + b_i) & \text{Input gate}\\
f_t &= \sigma(x_t.W_f + h_{t-1}.U_f + C_{t-1}.P_f + b_f) & \text{Forget gate}\\
\tilde{C_t} &= \tanh(x_t.W_c + h_{t-1}.U_c + b_c) & \text{Cell gate}\\
C_t &= f_t * C_{t-1} + i_t * \tilde{C_t} & \text{Cell state}\\
o_t &= \sigma(x_t.W_o + h_{t-1}.U_o + C_t.P_o + b_o) & \text{Output gate}\\
h_t &= o_t * \tanh(C_t) & \text{Hidden state}\\
with tied forget and input gates:
.. math ::
C_t &= f_t * C_{t-1} + (1 - f_t) * \tilde{C_t} & \texte{Cell state}\\
C_t &= f_t * C_{t-1} + (1 - f_t) * \tilde{C_t} & \text{Cell state}\\
Parameters
----------
Expand All @@ -734,7 +734,7 @@ class LSTM(Layer):
activation : `yadll.activations` function default is `yadll.activations.tanh`
activation function
last_only: boolean default is True
set to true if you only need the last element of the
set to true if you only need the last element of the output sequence
References
----------
Expand Down

0 comments on commit cb31894

Please sign in to comment.