trainer(model, loss_fn, X_train, y_train=None, optimizer=tensorflow.keras.optimizers.Adam, loss_fn_kwargs=None, preprocess_fn=None, epochs=20, batch_size=64, buffer_size=1024, verbose=True, log_metric=None, callbacks=None)¶
Train TensorFlow model.
model – Model to train.
loss_fn – Loss function used for training.
X_train – Training batch.
y_train – Training labels.
optimizer – Optimizer used for training.
loss_fn_kwargs – Kwargs for loss function.
preprocess_fn – Preprocessing function applied to each training batch.
epochs – Number of training epochs.
batch_size – Batch size used for training.
buffer_size – Maximum number of elements that will be buffered when prefetching.
verbose – Whether to print training progress.
log_metric – Additional metrics whose progress will be displayed if verbose equals True.
callbacks – Callbacks used during training.