Fix weights correction

This commit is contained in:
2026-03-23 17:13:53 +01:00
parent b25aaba088
commit a84c3d999d
9 changed files with 54 additions and 24 deletions

View File

@@ -68,8 +68,9 @@ public class Main {
Network network = new Network(List.of(layer));
TrainingContext context = new TrainingContext();
context.dataset = dataSet;
context.dataset = orDataSet;
context.model = network;
context.learningRate = 0.3F;
List<TrainingStep> steps = List.of(
new PredictionStep(),
@@ -81,8 +82,8 @@ public class Main {
TrainingPipeline pipeline = new TrainingPipeline(steps);
pipeline
.stopCondition(ctx -> ctx.globalLoss == 0 && ctx.epoch >= 1000)
.afterEpoch(ctx -> ctx.globalLoss = 0)
.stopCondition(ctx -> ctx.globalLoss == 0.0F || ctx.epoch > 100)
.beforeEpoch(ctx -> ctx.globalLoss = 0)
.withVerbose(true)
.run(context);