if config == 1: # this works pretty well (approximates sum) useRecurrent = True pMut = 0.1 pCross = 0.9; popsize = 3; maxgen = 1; elif config ==2: useRecurrent = True pMut = 0.1 pCross = 0.9; popsize = 5; maxgen = 15; ################# ea = EA(INdim,OUTdim, numIns,numOuts, maxgen,popsize,minw,maxw); ea.setProbabilities(pMut,pCross); ea.initPop(); print 'starting build' # evolution insert here # expNo = round(1000000*random.random(),0); # generate some number for text file data print expNo f = open('data/ea_%d.txt'%expNo, 'w'); # evolution insert here while ea.wantsEval(): print 'Gen: '+repr(ea.generation())+'/'+repr(maxgen)+' actual ind is ' +repr(ea.actualOne())+'/'+repr(popsize)+' best so far: '+repr(ea.getBestFitness()); ind = ea.getInd(); #ind.printMatrix();
# which setup to use? config=1 if config == 1: # this works pretty well (approximates sum) useRecurrent =True pMut = 0.1 pCross = 0.9; popsize = 3; maxgen = 1; N=2 print N ################# ea = EA(INdim, OUTdim, N, maxgen,popsize,minw,maxw); ea.setProbabilities(pMut,pCross); ea.initPop(); print 'starting build' # evolution insert here ind = ea.getInd(); ind.printMatrix(); net = buildExperiment(ind); print 'build done \n\n'
if config == 1: # this works pretty well (approximates sum) useRecurrent = True pMut = 0.1 pCross = 0.9 popsize = 3 maxgen = 1 elif config == 2: useRecurrent = True pMut = 0.1 pCross = 0.9 popsize = 5 maxgen = 15 ################# ea = EA(INdim, OUTdim, numIns, numOuts, maxgen, popsize, minw, maxw) ea.setProbabilities(pMut, pCross) ea.initPop() print 'starting build' # evolution insert here # expNo = round(1000000 * random.random(), 0) # generate some number for text file data print expNo f = open('data/ea_%d.txt' % expNo, 'w') # evolution insert here while ea.wantsEval(): print 'Gen: ' + repr( ea.generation()) + '/' + repr(maxgen) + ' actual ind is ' + repr( ea.actualOne()) + '/' + repr(popsize) + ' best so far: ' + repr(