now works

This commit is contained in:
gustavoromero 2000-11-28 13:36:29 +00:00
commit 65a985631c
2 changed files with 5 additions and 8 deletions

View file

@ -11,7 +11,7 @@
#include <eoPop.h> // eoPop
#include <eoGenContinue.h> // eoGenContinue
#include <eoProportional.h> // eoProportional
#include <eoStochTournament.h>
#include <eoStochTournament.h> // eoStochTournament
#include <eoSGA.h> // eoSGA
#include "gprop.h" // Chrom eoChromInit eoChromMutation eoChromXover eoChromEvaluator
@ -92,10 +92,6 @@ void arg(int argc, char** argv)
in = trn_set.front().input.size();
out = trn_set.front().output.size();
hidden = hiddenp.value();
cout << trn_set << endl;
cout << in << " " << out << " " << hidden << endl;
}
//-----------------------------------------------------------------------------

View file

@ -30,11 +30,9 @@ struct phenotype
static unsigned trn_max, val_max, tst_max;
// operator double(void) const { return val_ok; }
friend bool operator<(const phenotype& a, const phenotype& b)
{
return a.val_ok < b.val_ok; // || (!(a.val_ok < b.val_ok) && a.mse_error < b.mse_error);
return a.val_ok < b.val_ok || !(b.val_ok < a.val_ok) && b.mse_error < a.mse_error;
}
friend ostream& operator<<(ostream& os, const phenotype& p)
@ -119,6 +117,7 @@ public:
{
mse::net tmp(chrom);
tmp.train(trn_set, 10, 0, 0.001);
chrom.invalidate();
}
private:
@ -140,6 +139,8 @@ public:
mse::net tmp1(chrom1), tmp2(chrom2);
tmp1.train(trn_set, 100, 0, 0.001);
tmp2.train(trn_set, 100, 0, 0.001);
chrom1.invalidate();
chrom2.invalidate();
}
};