2023-01-06 18:27:56 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2023-05-12 16:16:34 +02:00
|
|
|
#include "../src/common/include/colors.h"
|
2023-01-06 18:27:56 +01:00
|
|
|
#include "../src/cnn/include/creation.h"
|
|
|
|
#include "../src/cnn/include/utils.h"
|
|
|
|
#include "../src/cnn/include/free.h"
|
|
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
Kernel* kernel;
|
|
|
|
printf("Création du réseau\n");
|
|
|
|
Network* network = create_network_lenet5(0, 0, 3, 2, 32, 1);
|
|
|
|
printf(GREEN "OK\n" RESET);
|
|
|
|
|
|
|
|
printf("Architecture LeNet5:\n");
|
2023-01-17 15:25:34 +01:00
|
|
|
for (int i=0; i < network->size-1; i++) {
|
2023-01-06 18:27:56 +01:00
|
|
|
kernel = network->kernel[i];
|
|
|
|
if ((!kernel->cnn)&&(!kernel->nn)) {
|
2023-03-08 20:48:34 +01:00
|
|
|
if (kernel->pooling == AVG_POOLING) {
|
2023-02-03 15:12:59 +01:00
|
|
|
printf("\n==== Couche %d de type "YELLOW"Average Pooling"RESET" ====\n", i);
|
|
|
|
} else {
|
|
|
|
printf("\n==== Couche %d de type "YELLOW"Max Pooling"RESET" ====\n", i);
|
|
|
|
}
|
2023-01-06 18:27:56 +01:00
|
|
|
} else if (!kernel->cnn) {
|
|
|
|
printf("\n==== Couche %d de type "GREEN"NN"RESET" ====\n", i);
|
2023-02-19 12:50:27 +01:00
|
|
|
printf("input: %d\n", kernel->nn->size_input);
|
2023-02-19 12:53:08 +01:00
|
|
|
printf("output: %d\n", kernel->nn->size_output);
|
2023-01-06 18:27:56 +01:00
|
|
|
} else {
|
|
|
|
printf("\n==== Couche %d de type "BLUE"CNN"RESET" ====\n", i);
|
|
|
|
printf("k_size: %d\n", kernel->cnn->k_size);
|
|
|
|
printf("rows: %d\n", kernel->cnn->rows);
|
|
|
|
printf("columns: %d\n", kernel->cnn->columns);
|
|
|
|
}
|
2023-01-13 15:59:04 +01:00
|
|
|
if (kernel->linearisation) {
|
|
|
|
printf(YELLOW"Linéarisation: %d\n"RESET, kernel->linearisation);
|
|
|
|
}
|
2023-01-06 18:27:56 +01:00
|
|
|
printf("width: %d\n", network->width[i]);
|
|
|
|
printf("depth: %d\n", network->depth[i]);
|
2023-01-13 15:59:04 +01:00
|
|
|
printf("activation: %d\n", kernel->activation);
|
2023-01-06 18:27:56 +01:00
|
|
|
}
|
2023-03-03 22:06:25 +01:00
|
|
|
printf("\n" GREEN "OK\n" RESET);
|
2023-01-06 18:27:56 +01:00
|
|
|
|
|
|
|
printf("Libération de la mémoire\n");
|
|
|
|
free_network(network);
|
|
|
|
printf(GREEN "OK\n" RESET);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|