ggml_layer_conv_1d: Add 1D Convolution Layer

View source: R/nn_layers.R

ggml_layer_conv_1dR Documentation

Add 1D Convolution Layer

Description

Add 1D Convolution Layer

Usage

ggml_layer_conv_1d(
  model,
  filters,
  kernel_size,
  activation = NULL,
  input_shape = NULL,
  strides = 1L,
  padding = "valid",
  name = NULL,
  trainable = TRUE
)

Arguments

model

A ggml_sequential_model object

filters

Number of output filters

kernel_size

Integer kernel size

activation

Activation function name: "relu", "sigmoid", "tanh", "softmax", or NULL

input_shape

Input shape c(L, C) - required for first layer only (length, channels)

strides

Integer stride (default 1)

padding

"valid" (no padding) or "same" (preserve length)

name

Optional character name for the layer.

trainable

Logical; whether the layer weights are updated during training.

Value

The model object with the conv_1d layer appended (invisibly).

Examples


model <- ggml_model_sequential() |>
  ggml_layer_conv_1d(32, 3, activation = "relu",
                     input_shape = c(100, 1))


ggmlR documentation built on Oct. 23, 2026, 1:07 a.m.