From 0f674b5b2f15c5cd30209230f22198cc71e74310 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 15 Nov 2008 02:42:01 +0000 Subject: Clean neural struct git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@51 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- cleanbench.c | 2 +- neural.c | 24 +++++++++++++----------- nmglobal.h | 19 ------------------- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/cleanbench.c b/cleanbench.c index 3b17ee7..af58fc3 100644 --- a/cleanbench.c +++ b/cleanbench.c @@ -84,7 +84,7 @@ puts("\nTEST : Iterations/sec. : Old Index : New Index"); puts(" : : Pentium 90* : AMD K6/233*"); puts("--------------------:------------------:-------------:------------"); -for(i=HUFFMAN;iloops = 1; locnnetstruct->loops < MAXNNETLOOPS; locnnetstruct->loops++) { + for (; loops < LOOP_MAX; loops++) { randnum((int32_t)3); - if(DoNNetIteration(locnnetstruct->loops) > MINIMUM_TICKS) { + if(DoNNetIteration(loops) > MINIMUM_TICKS) { break; } } @@ -162,8 +164,8 @@ DoNNET(void) do { randnum((int32_t)3); /* Gotta do this for Neural Net */ - total_time += DoNNetIteration(locnnetstruct->loops); - iterations += locnnetstruct->loops; + total_time += DoNNetIteration(loops); + iterations += loops; } while (total_time < MINIMUM_SECONDS * CLOCKS_PER_SEC); locnnetstruct->results = (double)(iterations * CLOCKS_PER_SEC) / total_time; diff --git a/nmglobal.h b/nmglobal.h index 85f030b..432a2dc 100644 --- a/nmglobal.h +++ b/nmglobal.h @@ -66,27 +66,8 @@ typedef struct { double results; /* Results */ } HuffStruct; -/******************************** -** BACK PROPAGATION NEURAL NET ** -********************************/ - -/* -** MAXNNETLOOPS -** -** This constant sets the max number of loops through the neural -** net that the system will attempt before giving up. This -** is not a critical constant. You can alter it if your system -** has sufficient horsepower. -*/ -/*#define MAXNNETLOOPS 50000L*/ -#define MAXNNETLOOPS 500000L - -/* -** TYPEDEFS -*/ typedef struct { double results; /* Results */ - unsigned long loops; /* # of times to learn */ } NNetStruct; /*********************** -- cgit v1.2.3