NNffbpAlphaTabFast { public double[] calc(double[] nninp) { double[] res = new double[nn_out]; for (int i = 0; i < nn_in; i++) { act[0][i] = (nninp[i] - inmin[i]) / (inmax[i] - inmin[i]); } for (int pl = 0; pl < nplanes - 1; pl++) { final double[] bias_pl = bias[pl]; final double[][] wgt_pl = wgt[pl]; final double[] act_pl = act[pl]; final double[] act_pl1 = act[pl + 1]; final int size_pl1 = size[pl + 1]; for (int i = 0; i < size_pl1; i++) { act_pl1[i] = activation(bias_pl[i] + scp(wgt_pl[i], act_pl)); } } final double[] act_nnplanes1 = act[nplanes - 1]; for (int i = 0; i < nn_out; i++) { res[i] = act_nnplanes1[i] * (outmax[i] - outmin[i]) + outmin[i]; } return res; } NNffbpAlphaTabFast(String neuralNet);  NNffbpAlphaTabFast(InputStream neuralNetStream); double[] getInmin(); void setInmin(double[] inmin); double[] getInmax(); void setInmax(double[] inmax); double[] getOutmin(); double[] getOutmax(); NNCalc calcJacobi(double[] nnInp); double[] calc(double[] nninp);  }
@Test public void testCalcPerformance() { final NNffbpAlphaTabFast tab = loadTestNet(); final double[] nnInput = new double[]{1.0, 3.4, 6.988, 4.4, 7.0, 16.21}; final long t1 = System.nanoTime(); final int N = 100000; for (int i = 0; i < N; i++) { final double[] doubles = nnInput.clone(); for (int j = 0; j < doubles.length; j++) { doubles[j] += 1.0e-5 * Math.random(); } final double[] nnCalc = tab.calc(doubles); assertTrue(nnCalc[0] != 0.0); } final long t2 = System.nanoTime(); final double seconds = (t2 - t1) / 1.0e9; System.out.println("testCalcPerformance: " + seconds + " seconds"); assertTrue(seconds < 1.0); }