| ggml_layer_gru | R Documentation |
Gated Recurrent Unit recurrent layer. Implemented as an unrolled computation graph (BPTT).
ggml_layer_gru(
model,
units,
return_sequences = FALSE,
activation = "tanh",
recurrent_activation = "sigmoid",
input_shape = NULL,
name = NULL,
trainable = TRUE
)
model |
A |
units |
Integer, number of hidden units. |
return_sequences |
Logical; return all hidden states or only the last. |
activation |
Activation for the candidate hidden state ( |
recurrent_activation |
Activation for z/r gates ( |
input_shape |
Input shape |
name |
Optional layer name. |
trainable |
Logical. |
Updated model or a new ggml_tensor_node.
W_zh [input_size, 2*units] — input kernel for z and r
gates.
U_zh [units, 2*units] — recurrent kernel for z and r.
b_zh [2*units] — bias for z and r.
W_n [input_size, units] — input kernel for candidate.
U_n [units, units] — recurrent kernel for candidate.
b_n [units] — bias for candidate.
model <- ggml_model_sequential() |>
ggml_layer_gru(64L, input_shape = c(10L, 32L)) |>
ggml_layer_dense(10L, activation = "softmax")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.