tinn/test.c

21 lines
426 B
C
Raw Normal View History

2018-03-29 06:55:49 +03:00
#include "Tinn.h"
2018-03-27 00:11:15 +03:00
#include <stdio.h>
2018-03-29 08:04:47 +03:00
2018-03-30 00:32:11 +03:00
#define len(a) ((int) (sizeof(a) / sizeof(*a)))
2018-03-29 08:04:47 +03:00
2018-03-30 00:32:11 +03:00
int main(void)
2018-03-29 06:55:49 +03:00
{
2018-03-30 00:32:11 +03:00
double in[] = { 0.05, 0.10 };
double tg[] = { 0.01, 0.99 };
/* Two hidden nuerons */
const Tinn tinn = xtbuild(len(in), 2, len(tg));
2018-03-29 06:55:49 +03:00
int i;
2018-03-30 00:32:11 +03:00
for(i = 0; i < 10000; i++)
{
double error = xttrain(tinn, in, tg, 0.5);
printf("%.12f\n", error);
}
2018-03-29 22:51:36 +03:00
xtfree(tinn);
2018-03-27 00:11:15 +03:00
return 0;
}