diff --git a/src/mnist/main.c b/src/mnist/main.c index 90b5e4c..c413160 100644 --- a/src/mnist/main.c +++ b/src/mnist/main.c @@ -7,7 +7,7 @@ #include "neuron_io.c" #include "mnist.c" -#define EPOCHS 100 +#define EPOCHS 10 #define BATCHES 100 diff --git a/src/mnist_cnn/cnn.c b/src/mnist_cnn/cnn.c new file mode 100644 index 0000000..afbc8fb --- /dev/null +++ b/src/mnist_cnn/cnn.c @@ -0,0 +1,16 @@ +#define PADING_INPUT 2 + +void write_image_in_newtork_32(int** image, int height, int width, float** network) { + /* Ecrit une image 28*28 au centre d'un tableau 32*32 et met à 0 le reste */ + + for (int i=0; i < height+2*PADING_INPUT; i++) { + for (int j=PADING_INPUT; j < width+2*PADING_INPUT; j++) { + if (iheight+PADING_INPUT || jwidth+PADING_INPUT){ + network[i][j] = 0.; + } + else { + network[i][j] = (float)image[i][j] / 255.0f; + } + } + } +} diff --git a/src/matrix/matrix_2d.c b/src/mnist_cnn/matrix/matrix_2d.c similarity index 100% rename from src/matrix/matrix_2d.c rename to src/mnist_cnn/matrix/matrix_2d.c diff --git a/src/matrix/matrix_3d.c b/src/mnist_cnn/matrix/matrix_3d.c similarity index 100% rename from src/matrix/matrix_3d.c rename to src/mnist_cnn/matrix/matrix_3d.c