8485868788899091929394
ContinuousACO train = new ContinuousACO(network, score, 30); performIterations(train, 100000, 0.05, true); train.finishTraining(); queryOneOfN(network, trainingData, species); } catch (Throwable t) {
167168169170171172173174175176177
} System.out.println("Good solution found:"); TreeGenome best = (TreeGenome) genetic.getBestGenome(); System.out.println(eval.displayExpressionNormal(best.getRoot())); genetic.finishTraining(); } /** * Main entry point. *
6364656667686970717273
for(int i=1;i<=20;i++) { train.iteration(); System.out.println("Iteration #" + i + " Error:" + train.getError()); } train.finishTraining(); long stop = System.currentTimeMillis(); double diff = ((double)(stop - start))/1000.0; System.out.println("RPROP Result:" + diff + " seconds." ); System.out.println("Final RPROP error: " + network.calculateError(data)); return diff;
8384858687888990919293
for(int i=1;i<=20;i++) { train.iteration(); System.out.println("Iteration #" + i + " Error:" + train.getError()); } train.finishTraining(); long stop = System.currentTimeMillis(); double diff = ((double)(stop - start))/1000.0; System.out.println("MPROP Result:" + diff + " seconds." ); System.out.println("Final MPROP error: " + network.calculateError(data)); return diff;
5253545556575859
rprop.iteration(); rprop.iteration(); // these connections were removed, and should not have been "trained" Assert.assertEquals(0.0, network.getStructure().getFlat().getWeights()[0], 0.01); Assert.assertEquals(0.0, network.getStructure().getFlat().getWeights()[1], 0.01); rprop.finishTraining(); } }