private void testSetIt() { neurNet.set(dataCrosValid, Parameters.dataModifier); double err = neurNet.calcANN(getBestVector()); try { PrintWriter pw = new PrintWriter(new FileWriter(new File(Parameters.CrossValidationErrorFile), true)); pw.println(err); pw.close(); } catch (Exception e) { e.printStackTrace(); } neurNet.set(dataStart, Parameters.dataModifier); }
@Override public void set(int numOfWeights, INeuralNetwork neurNet) { this.dim = numOfWeights; this.neurNet = neurNet; this.popNum = Parameters.NumOfUnits; this.maxGenNoChamdge = Parameters.MaxNumOfGenWithoutChaindge; this.strategy = Parameters.strategy; this.F = Parameters.F; this.Cr = Parameters.Cr; this.initMax = Parameters.initMax; this.initMin = Parameters.initMin; this.rand = new Random(); if (Parameters.enableCrossVal) { dataStart = neurNet.getData(); dataCrosValid = Parameters.testgSet.getData(Parameters.testDataPath); Parameters.dataModifier.modyfyData(dataCrosValid); File f = new File(Parameters.CrossValidationErrorFile); f.delete(); } }
private void evalOne(Unit unit) { unit.fitnes = neurNet.calcANN(unit.vector); }