std1.0.0-beta-7 SafeC docs

std :: ml::rnn

Struct std::GRUCell

#include <std/ml/rnn.h> source

struct GRUCell {
    &FloatTensor W_ir;
    &FloatTensor W_hr;
    &FloatTensor b_ir;
    &FloatTensor b_hr;
    &FloatTensor W_iz;
    &FloatTensor W_hz;
    &FloatTensor b_iz;
    &FloatTensor b_hz;
    &FloatTensor W_in;
    &FloatTensor W_hn;
    &FloatTensor b_in;
    &FloatTensor b_hn;
}

r_t = sigmoid(x_t@W_ir + h@W_hr + b_ir + b_hr) reset gate z_t = sigmoid(x_t@W_iz + h@W_hz + b_iz + b_hz) update gate n_t = tanh(x_t@W_in + b_in + r_t * (h@W_hn + b_hn)) candidate h_t = (1 - z_t) * n_t + z_t * h_{t-1}

Fields

Methods

§&FloatTensor forward(const &FloatTensor x_t, const &FloatTensor h_prev) constsource · definition
§void collect_params(&Vec<&FloatTensor> out) constsource · definition

Parameterized (module.h): every weight tensor.

§void collect_state(&Vec<&FloatTensor> out) constsource · definition
§void drop()source · definition
§void free() consumesource · definition

= drop()

§static struct GRUCell new(unsigned long inputSize, unsigned long hiddenSize)source · definition