From 5d475f9dadcac74bde8262d600e68578e91323c9 Mon Sep 17 00:00:00 2001 From: tslil Date: Mon, 11 Jan 2021 01:29:39 -0500 Subject: Close in principle, but there;s a bug in ct1997 &/ pptdb! --- include/ct1973.c | 702 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 689 insertions(+), 13 deletions(-) (limited to 'include/ct1973.c') diff --git a/include/ct1973.c b/include/ct1973.c index da56d19..78be1f5 100644 --- a/include/ct1973.c +++ b/include/ct1973.c @@ -1,10 +1,11 @@ #include "ct1973.h" -static float flattened[CONV_NUM+2]; -static float dense1[DENSE1_NUM]; -static float dense2[DENSE2_NUM]; +float flattened[CONV_NUM+2]; +float dense1[DENSE1_NUM]; +float dense2[DENSE2_NUM]; +float output[OUTPUT_NUM]; -#define RELU(x) ((x) = ((x)>0)?(x):0) +#define RELU(x) ((x) = ((x)<0)?0:(x)) float evaluate_black_win(void) { @@ -16,7 +17,7 @@ evaluate_black_win(void) { // the stride is 1, march across the board for (uint8_t by = 0; by < KERN_OSIZE; by++) { for (uint8_t bx = 0; bx < KERN_OSIZE; bx++) { - flattened[(k*KERN_OSIZE+by)*KERN_OSIZE+bx] = conv2d_biases[k]; + flattened[k+KERN_NUM*(by+bx*KERN_OSIZE)] = 0; // conv2d_biases[k]; // Compute the convolution for this position for (uint8_t ky = 0; ky < KERN_SIZE; ky++) { for (uint8_t kx = 0; kx < KERN_SIZE; kx++) { @@ -39,15 +40,18 @@ evaluate_black_win(void) { lookup = (colours[k] & (1<