@Test public void evaluateNotEnoughData() { TensorIO tensorIO = new TensorIO(Map.of( "input_1_1", Tensor.fromDoubleData(new double[] {3.14}))); Assertions.assertThrows( EvaluationException.class, () -> flowEvaluator.evaluate(tensorIO, new EvaluationContext())); }
@Override public TensorIO evaluate(TensorIO io, EvaluationContext evaluationContext) throws EvaluationException { if (io.getBatchSize() < rollingWindowsSize) { throw new EvaluationException( String.format("Not enough data to evaluate. Required batch size is %d", rollingWindowsSize) ); } TensorIO lastIO = new TensorIO(); lastIO.merge(io); for (Evaluator<?> evaluator : evaluators) { lastIO.merge(evaluator.evaluate(lastIO, evaluationContext)); if ( evaluationContext.shouldStop(true) || evaluationContext.shouldStop(false) ) { return lastIO; } evaluationContext.incCurrentEvaluator(); } lastIO.retainFields(outputs); evaluationContext.incEvaluationBy(lastIO.getBatchSize()); return lastIO; }
FlowEvaluator implements Evaluator { @Override public TensorIO evaluate(TensorIO io, EvaluationContext evaluationContext) throws EvaluationException { if (io.getBatchSize() < rollingWindowsSize) { throw new EvaluationException( String.format("Not enough data to evaluate. Required batch size is %d", rollingWindowsSize) ); } TensorIO lastIO = new TensorIO(); lastIO.merge(io); for (Evaluator<?> evaluator : evaluators) { lastIO.merge(evaluator.evaluate(lastIO, evaluationContext)); if ( evaluationContext.shouldStop(true) || evaluationContext.shouldStop(false) ) { return lastIO; } evaluationContext.incCurrentEvaluator(); } lastIO.retainFields(outputs); evaluationContext.incEvaluationBy(lastIO.getBatchSize()); return lastIO; } }
FlowEvaluator implements Evaluator { @Override public TensorIO evaluate(TensorIO io, EvaluationContext evaluationContext) throws EvaluationException { if (io.getBatchSize() < rollingWindowsSize) { throw new EvaluationException( String.format("Not enough data to evaluate. Required batch size is %d", rollingWindowsSize) ); } TensorIO lastIO = new TensorIO(); lastIO.merge(io); for (Evaluator<?> evaluator : evaluators) { lastIO.merge(evaluator.evaluate(lastIO, evaluationContext)); if ( evaluationContext.shouldStop(true) || evaluationContext.shouldStop(false) ) { return lastIO; } evaluationContext.incCurrentEvaluator(); } lastIO.retainFields(outputs); evaluationContext.incEvaluationBy(lastIO.getBatchSize()); return lastIO; } private  FlowEvaluator(
        List<Evaluator<?>> evaluators,
        List<? extends Field> inputs,
        List<? extends Field> outputs,
        int rollingWindowsSize
    ); }
FlowEvaluator implements Evaluator { @Override public TensorIO evaluate(TensorIO io, EvaluationContext evaluationContext) throws EvaluationException { if (io.getBatchSize() < rollingWindowsSize) { throw new EvaluationException( String.format("Not enough data to evaluate. Required batch size is %d", rollingWindowsSize) ); } TensorIO lastIO = new TensorIO(); lastIO.merge(io); for (Evaluator<?> evaluator : evaluators) { lastIO.merge(evaluator.evaluate(lastIO, evaluationContext)); if ( evaluationContext.shouldStop(true) || evaluationContext.shouldStop(false) ) { return lastIO; } evaluationContext.incCurrentEvaluator(); } lastIO.retainFields(outputs); evaluationContext.incEvaluationBy(lastIO.getBatchSize()); return lastIO; } private  FlowEvaluator(
        List<Evaluator<?>> evaluators,
        List<? extends Field> inputs,
        List<? extends Field> outputs,
        int rollingWindowsSize
    ); static FlowEvaluator create(FlowEvaluatorManifest flowEvaluatorManifest, String path); @Override TensorIO evaluate(TensorIO io, EvaluationContext evaluationContext); @Override List<? extends Field> getInputs(); @Override List<? extends Field> getOutputs(); @Override int getRollingWindowSize(); }
FlowEvaluator implements Evaluator { @Override public TensorIO evaluate(TensorIO io, EvaluationContext evaluationContext) throws EvaluationException { if (io.getBatchSize() < rollingWindowsSize) { throw new EvaluationException( String.format("Not enough data to evaluate. Required batch size is %d", rollingWindowsSize) ); } TensorIO lastIO = new TensorIO(); lastIO.merge(io); for (Evaluator<?> evaluator : evaluators) { lastIO.merge(evaluator.evaluate(lastIO, evaluationContext)); if ( evaluationContext.shouldStop(true) || evaluationContext.shouldStop(false) ) { return lastIO; } evaluationContext.incCurrentEvaluator(); } lastIO.retainFields(outputs); evaluationContext.incEvaluationBy(lastIO.getBatchSize()); return lastIO; } private  FlowEvaluator(
        List<Evaluator<?>> evaluators,
        List<? extends Field> inputs,
        List<? extends Field> outputs,
        int rollingWindowsSize
    ); static FlowEvaluator create(FlowEvaluatorManifest flowEvaluatorManifest, String path); @Override TensorIO evaluate(TensorIO io, EvaluationContext evaluationContext); @Override List<? extends Field> getInputs(); @Override List<? extends Field> getOutputs(); @Override int getRollingWindowSize();  }