summaryrefslogtreecommitdiff
path: root/neural.c
diff options
context:
space:
mode:
Diffstat (limited to 'neural.c')
-rw-r--r--neural.c82
1 files changed, 7 insertions, 75 deletions
diff --git a/neural.c b/neural.c
index e3e3c46..f814dc6 100644
--- a/neural.c
+++ b/neural.c
@@ -6,7 +6,7 @@
#include <limits.h>
#include <time.h>
-#include "nmglobal.h"
+#include "cleanbench.h"
#include "randnum.h"
@@ -104,7 +104,8 @@ static int check_out_error();
static void zero_changes();
static void randomize_wts();
static int read_data_file();
-/* static int initialize_net(); */
+
+static double results;
/***********
** DoNNet **
@@ -119,7 +120,6 @@ void
DoNNET(void)
{
/* const char* context="CPU:NNET"; */ /* Since we never fprintf errors here, we don't need this */
- NNetStruct* locnnetstruct = &global_nnetstruct;
clock_t total_time = 0;
int iterations = 0;
static int is_adjusted = FALSE;
@@ -168,7 +168,7 @@ DoNNET(void)
iterations += loops;
} while (total_time < MINIMUM_SECONDS * CLOCKS_PER_SEC);
- locnnetstruct->results = (double)(iterations * CLOCKS_PER_SEC) / total_time;
+ results = (double)(iterations * CLOCKS_PER_SEC) / total_time;
}
/********************
@@ -778,80 +778,12 @@ for (patt=0; patt<numpats; patt++)
out_pats[patt][element] = (double) val8; element++;
}
-/* printf("\n Closing the input file now. "); */
-
fclose(infile);
return(0);
}
-/*********************
-** initialize_net() **
-**********************
-** Do all the initialization stuff before beginning
-*/
-/*
-static int initialize_net()
-{
-int err_code;
-
-randomize_wts();
-zero_changes();
-err_code = read_data_file();
-iteration_count = 1;
-return(err_code);
-}
-*/
-
-/**********************
-** display_mid_wts() **
-***********************
-** Display the weights on the middle layer neurodes
-** NOTE: This routine is not used in the benchmark
-** test -- RG
-**/
-/* static void display_mid_wts()
-{
-int neurode, weight, row, col;
-
-fprintf(outfile,"\n Weights of Middle Layer neurodes:");
-
-for (neurode=0; neurode<MID_SIZE; neurode++)
-{
- fprintf(outfile,"\n Mid Neurode # %d",neurode);
- for (row=0; row<IN_Y_SIZE; row++)
- {
- fprintf(outfile,"\n ");
- for (col=0; col<IN_X_SIZE; col++)
- {
- weight = IN_X_SIZE * row + col;
- fprintf(outfile," %8.3f ", mid_wts[neurode][weight]);
- }
- }
-}
-return;
-}
-*/
-/**********************
-** display_out_wts() **
-***********************
-** Display the weights on the output layer neurodes
-** NOTE: This code is not used in the benchmark
-** test -- RG
-*/
-/* void display_out_wts()
+inline double
+getNNETScore(void)
{
-int neurode, weight;
-
- fprintf(outfile,"\n Weights of Output Layer neurodes:");
-
- for (neurode=0; neurode<OUT_SIZE; neurode++)
- {
- fprintf(outfile,"\n Out Neurode # %d \n",neurode);
- for (weight=0; weight<MID_SIZE; weight++)
- {
- fprintf(outfile," %8.3f ", out_wts[neurode][weight]);
- }
- }
- return;
+ return results;
}
-*/