Learn R Programming

ggmlR (version 0.6.1)

ggml_layer_max_pooling_2d: Add 2D Max Pooling Layer

Description

Add 2D Max Pooling Layer

Usage

ggml_layer_max_pooling_2d(
  model,
  pool_size = c(2L, 2L),
  strides = NULL,
  name = NULL,
  trainable = TRUE
)

Value

The model object with the max pooling layer appended (invisibly).

Arguments

model

A ggml_sequential_model object

pool_size

Integer or vector of 2 integers for pool height and width

strides

Integer or vector of 2 integers (defaults to pool_size)

name

Optional character name for the layer.

trainable

Logical; reserved for API consistency (no weights).

Examples

Run this code
# \donttest{
model <- ggml_model_sequential() |>
  ggml_layer_conv_2d(32, c(3,3), activation = "relu",
                     input_shape = c(28, 28, 1)) |>
  ggml_layer_max_pooling_2d(c(2, 2))
# }

Run the code above in your browser using DataLab