if (FALSE) {
# 3-class classifier on 20 features
model <- ggml_default_mlp(
n_features = 20L,
n_out = 3L,
task_type = "classif",
hidden_layers = c(64L, 32L),
dropout = 0.1
)
model <- ggml_compile(model, optimizer = "adam",
loss = "categorical_crossentropy")
# Single-output regressor
reg <- ggml_default_mlp(
n_features = 10L,
n_out = 1L,
task_type = "regr"
)
reg <- ggml_compile(reg, optimizer = "adam", loss = "mse")
}
Run the code above in your browser using DataLab