struct LSTMCell {
&FloatTensor W_ii;
&FloatTensor W_hi;
&FloatTensor b_ii;
&FloatTensor b_hi;
&FloatTensor W_if;
&FloatTensor W_hf;
&FloatTensor b_if;
&FloatTensor b_hf;
&FloatTensor W_ig;
&FloatTensor W_hg;
&FloatTensor b_ig;
&FloatTensor b_hg;
&FloatTensor W_io;
&FloatTensor W_ho;
&FloatTensor b_io;
&FloatTensor b_ho;
}i_t = sigmoid(x_t@W_ii + h@W_hi + b_ii + b_hi) input gate f_t = sigmoid(x_t@W_if + h@W_hf + b_if + b_hf) forget gate g_t = tanh(x_t@W_ig + h@W_hg + b_ig + b_hg) cell candidate o_t = sigmoid(x_t@W_io + h@W_ho + b_io + b_ho) output gate c_t = f_t * c_{t-1} + i_t * g_t h_t = o_t * tanh(c_t)
Fields
Methods
§
&FloatTensor forward(
const &FloatTensor x_t,
const &FloatTensor h_prev,
const &FloatTensor c_prev,
&&FloatTensor c_out,
) constsource · definitionWrites the new hidden state's tensor as the return value; '*c_out' receives the new cell state (caller-owned, like the return value).
Parameterized (module.h): every weight tensor.
= drop()