Class GRU

  • All Implemented Interfaces:
    Block

    public class GRU
    extends RecurrentBlock
    GRU is an abstract implementation of recurrent neural networks which applies GRU (Gated Recurrent Unit) recurrent layer to input.

    Current implementation refers the [paper](http://arxiv.org/abs/1406.1078) - Gated Recurrent Unit. The definition of GRU here is slightly different from the paper but compatible with CUDNN.

    The GRU operator is formulated as below:

    $$ \begin{split}\begin{array}{ll} r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\ z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\ n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\ h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\ \end{array}\end{split} $$

    • Method Detail

      • builder

        public static GRU.Builder builder()
        Creates a builder to build a GRU.
        Returns:
        a new builder