| fit.ggml_sequential_model | R Documentation |
Trains the model on data for a fixed number of epochs. This is the
keras-compatible interface; it delegates to ggml_fit.
## S3 method for class 'ggml_sequential_model'
fit(
object,
x,
y,
epochs = 1L,
batch_size = 32L,
validation_split = 0,
validation_data = NULL,
verbose = 1L,
callbacks = list(),
...
)
## S3 method for class 'ggml_functional_model'
fit(
object,
x,
y,
epochs = 1L,
batch_size = 32L,
validation_split = 0,
validation_data = NULL,
verbose = 1L,
callbacks = list(),
...
)
object |
A compiled model object. |
x |
Training data. Matrix, array, or list of matrices (multi-input). |
y |
Training labels (matrix, one-hot encoded for classification). |
epochs |
Number of training epochs (default 1). |
batch_size |
Batch size (default 32). |
validation_split |
Fraction of data for validation (default 0). |
validation_data |
Optional |
verbose |
0 = silent, 1 = progress (default 1). |
callbacks |
List of callback objects (default |
... |
Additional arguments passed to |
The trained model (invisibly), with model$history.
model <- ggml_model_sequential() |>
ggml_layer_dense(10, activation = "softmax", input_shape = 4)
model <- compile(model, optimizer = "adam",
loss = "categorical_crossentropy")
# model <- fit(model, x_train, y_train, epochs = 5, batch_size = 32)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.