mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 15:16:26 +01:00
Add cnn structure test
This commit is contained in:
parent
76547dc382
commit
5fa5a79b0c
45
test/cnn_structure.c
Normal file
45
test/cnn_structure.c
Normal file
@ -0,0 +1,45 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "../src/include/colors.h"
|
||||
#include "../src/cnn/include/creation.h"
|
||||
#include "../src/cnn/include/utils.h"
|
||||
#include "../src/cnn/include/free.h"
|
||||
#include "../src/include/colors.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");
|
||||
for (int i=0; i < network->size; i++) {
|
||||
kernel = network->kernel[i];
|
||||
if ((!kernel->cnn)&&(!kernel->nn)) {
|
||||
printf("\n==== Couche %d de type "YELLOW"Pooling"RESET" ====\n", i);
|
||||
printf("Linéarisation: %d\n", kernel->linearisation);
|
||||
} else if (!kernel->cnn) {
|
||||
printf("\n==== Couche %d de type "GREEN"NN"RESET" ====\n", i);
|
||||
printf("input: %d\n", kernel->nn->input_units);
|
||||
printf("output: %d\n", kernel->nn->output_units);
|
||||
} 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);
|
||||
}
|
||||
printf("width: %d\n", network->width[i]);
|
||||
printf("depth: %d\n", network->depth[i]);
|
||||
}
|
||||
printf(GREEN "\nOK\n" RESET);
|
||||
|
||||
printf("Libération de la mémoire\n");
|
||||
free_network(network);
|
||||
printf(GREEN "OK\n" RESET);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user