package com.naaturel.ANN.implementation.simplePerceptron;

import com.naaturel.ANN.domain.abstraction.AlgorithmStrategy;

public class SimpleLossStrategy implements AlgorithmStrategy {

    private final SimpleTrainingContext context;

    public SimpleLossStrategy(SimpleTrainingContext context) {
        this.context = context;
    }

    @Override
    public void apply() {
        this.context.localLoss = this.context.deltas.stream().reduce(0.0F, Float::sum);
    }
}
