| compile.ggml_sequential_model | R Documentation |
Configures the model for training by setting the optimizer, loss function,
and metrics. This is the keras-compatible interface; it delegates to
ggml_compile.
## S3 method for class 'ggml_sequential_model'
compile(
object,
optimizer = "adam",
loss = "categorical_crossentropy",
metrics = c("accuracy"),
...
)
## S3 method for class 'ggml_functional_model'
compile(
object,
optimizer = "adam",
loss = "categorical_crossentropy",
metrics = c("accuracy"),
...
)
object |
A model object (e.g. |
optimizer |
Character: |
loss |
Character: |
metrics |
Character vector of metrics (default |
... |
Additional arguments passed to |
The compiled model (invisibly).
model <- ggml_model_sequential() |>
ggml_layer_dense(10, activation = "softmax", input_shape = 4)
model <- compile(model, optimizer = "adam",
loss = "categorical_crossentropy")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.