| ggml_layer_dense | R Documentation |
Add Dense (Fully Connected) Layer
ggml_layer_dense(
model,
units,
activation = NULL,
input_shape = NULL,
name = NULL,
trainable = TRUE
)
model |
A ggml_sequential_model object |
units |
Number of output units |
activation |
Activation function name: "relu", "sigmoid", "tanh", "softmax", or NULL |
input_shape |
Integer or integer vector specifying the input shape (only needed for the first layer) |
name |
Optional character name for the layer. |
trainable |
Logical; whether the layer weights are updated during training. |
The model object with the dense layer appended (invisibly).
model <- ggml_model_sequential() |>
ggml_layer_conv_2d(32, c(3,3), activation = "relu",
input_shape = c(28, 28, 1)) |>
ggml_layer_flatten() |>
ggml_layer_dense(128, activation = "relu")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.