/** * bp372trainer.c * * A training program for backprop networks. */ #include "backprop.h" #include "bp372.h" #include "training_data.h" #include #include #include #define MAX_EPOCHS 1000 // maximum number of epochs #define TOLERANCE 0.1 // maximum allowed error in output vector int main(int argc, char* argv[]) { int i,j,k; double error, tolerance; int max_epochs; char* filename; // Allocate memory for the network. /* float x1[IN_SIZE]; float W1[HID_SIZE][IN_SIZE]; float y1[HID_SIZE]; float g1[HID_SIZE]; float x2[HID_SIZE]; float W2[OUT_SIZE][HID_SIZE]; float y2[OUT_SIZE]; float g2[OUT_SIZE]; */ // Default settings tolerance = TOLERANCE; max_epochs = MAX_EPOCHS; RandomizeNetwork(&network); // Load data from file if filename is present if(argc>0) { filename=NULL; for(i=0;i tolerance && k=max_epochs) { printf("warning: maximum epochs reached\n"); } // Input data to network and activate printf("\nAfter training\n"); for(j=0;j0) { filename=NULL; for(i=0;i