mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-24 07:36:24 +01:00
Add "mnist_cnn" folder
This commit is contained in:
parent
3046b502bd
commit
6532ad2545
@ -7,7 +7,7 @@
|
|||||||
#include "neuron_io.c"
|
#include "neuron_io.c"
|
||||||
#include "mnist.c"
|
#include "mnist.c"
|
||||||
|
|
||||||
#define EPOCHS 100
|
#define EPOCHS 10
|
||||||
#define BATCHES 100
|
#define BATCHES 100
|
||||||
|
|
||||||
|
|
||||||
|
16
src/mnist_cnn/cnn.c
Normal file
16
src/mnist_cnn/cnn.c
Normal file
@ -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 (i<PADING_INPUT || i>height+PADING_INPUT || j<PADING_INPUT || j>width+PADING_INPUT){
|
||||||
|
network[i][j] = 0.;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
network[i][j] = (float)image[i][j] / 255.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user