train

fun train(epochDataProvider: Supplier<Iterator<Pair<Tensor<*, *>, Tensor<*, *>>>>, epochs: Int): TrainingResult(source)

Train the model for the specified number of epochs using an iterable of (input, target) pairs per epoch.

Return

Training result with final loss.

Parameters

epochDataProvider

Function that returns an Iterator of (x, y) tensor pairs for each epoch. Called once per epoch.

epochs

Number of training epochs.