Learn R Programming

ggmlR (version 0.6.1)

ggml_pop_layer: Remove the Last Layer from a Sequential Model

Description

Removes the last layer from the model. The model must not be compiled.

Usage

ggml_pop_layer(model)

Value

The model with the last layer removed.

Arguments

model

A ggml_sequential_model object

Examples

Run this code
# \donttest{
model <- ggml_model_sequential() |>
  ggml_layer_dense(64, activation = "relu") |>
  ggml_layer_dense(10, activation = "softmax")

model <- ggml_pop_layer(model)
length(model$layers)  # 1
# }

Run the code above in your browser using DataLab