runTraining method
Executes a single full training step consisting of the Forward, Backward, and Optimize tapes.
Optionally accepts inputData and targetData to overwrite the respective VRAM buffers before execution.
Implementation
void runTraining({List<double>? inputData, List<double>? targetData}) {
if (inputData != null) {
input.pushData(inputData);
}
if (targetData != null && target != null) {
target!.pushData(targetData);
}
optimizer?.refreshStep(trainOptimize);
GPUEngine.run(trainForward.bytes());
GPUEngine.run(trainBackward.bytes());
GPUEngine.run(trainOptimize.bytes());
}