/* GENERATES THE SIGMOID LOOK-UP TABLE FILE FOR MLP.C Author: Robert John Morton YE572246C Decmber 1997 */ #include #include //for the exp() function to generate sigmoid look-up table #define R 32767 //maximum short (16-bit bipolar) interger magnitude #define RR 65556 //65534+22 double the above + an end adjustment for sigmoid main() { int i, I; short x; //open the sigmoid function look-up table file FILE *sh = fopen("SIGMOID.DAT", "wb"); for (i = 0; i < 1024; i++) //generate the sigmoid look-up table putw(x = (double)(RR / (1 + exp(-((double)(((long)(i)) << 8))/R)) - R), sh); putw(R, sh); }