View source: R/fit_generator.R
| ggml_fit_generator | R Documentation |
Streaming counterpart of ggml_fit for sequential models:
batches are pulled from a generator instead of being sliced out of a matrix
held in memory. Reachable either directly or as
ggml_fit(model, generator = ...).
ggml_fit_generator(
model,
generator,
steps_per_epoch = NULL,
epochs = 1L,
batch_size = 32L,
initial_epoch = 0L,
validation_generator = NULL,
validation_steps = NULL,
calibration_generator = NULL,
calibration_steps = NULL,
verbose = 1,
callbacks = list()
)
model |
A compiled |
generator |
Function of no arguments yielding |
steps_per_epoch |
Batches per epoch. Required for a generator that never
returns |
epochs |
Number of epochs to run |
batch_size |
Samples per batch. The graph is built for a fixed batch, so the generator must yield exactly this many; a short batch is an error rather than being padded. |
initial_epoch |
Epoch number to start counting from. Shifts the
numbering seen by callbacks and learning-rate schedules; it does not
restore optimizer state (see |
validation_generator |
Optional generator for validation, same contract. |
validation_steps |
Validation batches per epoch. |
calibration_generator |
Generator used to recompute batch-norm running
statistics after training. Defaults to |
calibration_steps |
Batches to draw for that calibration. |
verbose |
0 to silence per-epoch messages |
callbacks |
List of callback lists, as for |
Batches are given in the same R layout that x and y use; the
column-major conversion ggml wants happens internally, which is also what
lets a recorded batch feed batch-norm calibration unchanged.
The trained model, invisibly.
ggml_fit_opt_gen for the low-level loop this wraps.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.