powered by
Create a Conv2D Layer Object
Add 2D Convolution Layer
ggml_layer_conv_2d( model, filters, kernel_size, activation = NULL, input_shape = NULL, strides = c(1L, 1L), padding = "valid", name = NULL, trainable = TRUE )ggml_layer_conv_2d( model, filters, kernel_size, activation = NULL, input_shape = NULL, strides = c(1L, 1L), padding = "valid", name = NULL, trainable = TRUE )
ggml_layer_conv_2d( model, filters, kernel_size, activation = NULL, input_shape = NULL, strides = c(1L, 1L), padding = "valid", name = NULL, trainable = TRUE )
A ggml_layer object.
ggml_layer
The model object with the conv_2d layer appended (invisibly).
A ggml_sequential_model object
Number of output filters
Integer or vector of 2 integers for kernel height and width
Activation function name: "relu", "sigmoid", "tanh", "softmax", or NULL
Input shape c(H, W, C) - required for first layer only
Integer or vector of 2 integers for stride
"valid" (no padding) or "same" (preserve spatial dims)
Optional character name for the layer.
Logical; whether the layer weights are updated during training.
# \donttest{ model <- ggml_model_sequential() |> ggml_layer_conv_2d(32, c(3,3), activation = "relu", input_shape = c(28, 28, 1)) # }
Run the code above in your browser using DataLab