TrainingLoop
Java-friendly training loop wrapping SKaiNET's trainStep function.
Example usage from Java:
TrainingLoop loop = TrainingLoop.builder()
.model(model)
.loss(Losses.crossEntropy())
.optimizer(Optimizers.adam(0.001))
.context(ctx)
.build();
// Single step
float stepLoss = loop.step(inputBatch, targetBatch);
// Full training
TrainingResult result = loop.train(dataIterator, 10);Content copied to clipboard
Types
Functions
Link copied to clipboard
fun trainAsync(epochDataProvider: Supplier<Iterator<Pair<Tensor<*, *>, Tensor<*, *>>>>, epochs: Int): CompletableFuture<TrainingResult>
Train asynchronously using virtual threads.