View source: R/nn_functional.R
| ggml_dense | R Documentation |
Returns a reusable layer object for use with ggml_apply().
Applying the same object to multiple tensor nodes shares weights.
ggml_dense(units, activation = NULL, name = NULL, trainable = TRUE)
units |
Number of output units. |
activation |
Activation function name or NULL. |
name |
Optional character name. |
trainable |
Logical; whether weights are updated during training. |
A ggml_layer object.
encoder <- ggml_dense(64L, activation = "relu")
x1 <- ggml_input(shape = 32L)
x2 <- ggml_input(shape = 32L)
out1 <- x1 |> ggml_apply(encoder)
out2 <- x2 |> ggml_apply(encoder) # shared weights
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.