All Downloads are FREE. Search and download functionalities are using the official Maven repository.

neureka.autograd.PendingError Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package neureka.autograd;

import lombok.Getter;
import lombok.ToString;
import lombok.experimental.Accessors;
import neureka.Tsr;
import neureka.calculus.assembly.FunctionBuilder;

@Accessors( prefix = {"_"} )
@ToString
public class PendingError
{
    @Getter
    private int _toBeReceived;
    @Getter
    private final Tsr _accumulatedError;

    public PendingError( Tsr error, int toBeReceived ) {
        _toBeReceived = toBeReceived;
        _accumulatedError = error;
    }

    public void accumulate( Tsr error ) {
        FunctionBuilder.build(
                "I[ 0 ]<-(I[ 0 ]+I[ 1 ])", false
        ).call( new Tsr[]{ _accumulatedError, error } );
        _toBeReceived--;
    }

    public boolean isFullyAccumulated() {
        return _toBeReceived == 0;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy