Skip to content

Instantly share code, notes, and snippets.

@radiosilence
Created December 2, 2009 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radiosilence/247598 to your computer and use it in GitHub Desktop.
Save radiosilence/247598 to your computer and use it in GitHub Desktop.
void numtest( double learnparas[], int numhid, int emax, int usevalid, int wopt, char *tstr, char *vstr, char *ustr )
{
// test network on the numerical problem
// specified are the learning rate, momentum, number of hidden neurpons
// emax is max number of epochs for learning
// if usevalid then stop training when SSE on validation set starts to rise
// wopt is seed used to initialise random number generators used to initialise weights
// data files names are in tsr, vstr and ustr
int
ifprint = 0, // maximum number of epochs, epochs so far and ifprint
esofar = 0; // epochs so far SHLUD NAWT NEED THISS
char
och = ' ';
printf( "numhid: %d\n emax: %d\n usevalid: %d\n wopt: %d\n tstr: %s\n ustr: %s\n", numhid, emax, usevalid, wopt, tstr, vstr, ustr );
srand( wopt );
datasets train ( tstr, "training" );
datasets unseen ( ustr, "unseen");
LinActLayer *net = MakeNet( 'N', numhid, train );
passdata( net, train, 0 );
passdata( net, unseen, 0 );
for( int ct = 0; ct < emax; ct++ )
{
printf( "[%d] ", ct );
learndata( net, train, learnparas, ifprint );
passdata( net, train, 0 );
}
passdata( net, train, 0 );
passdata( net, unseen, 0 );
esofar = esofar + emax - 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment