2022-09-23 14:25:56 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2022-10-24 12:54:51 +02:00
|
|
|
#include "../src/include/colors.h"
|
|
|
|
#include "../src/cnn/include/neuron_io.h"
|
|
|
|
#include "../src/cnn/include/creation.h"
|
|
|
|
#include "../src/cnn/include/utils.h"
|
2022-09-23 14:25:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
printf("Création du réseau\n");
|
2022-10-03 10:04:11 +02:00
|
|
|
Network* network = create_network_lenet5(0, 0, 3, 2, 32, 1);
|
2022-09-23 14:25:56 +02:00
|
|
|
printf("OK\n");
|
|
|
|
|
|
|
|
printf("Écriture du réseau\n");
|
|
|
|
write_network(".test-cache/cnn_neuron_io.bin", network);
|
|
|
|
printf("OK\n");
|
|
|
|
|
|
|
|
printf("Vérification de l'accès en lecture\n");
|
2022-09-25 11:52:36 +02:00
|
|
|
Network* network2 = read_network(".test-cache/cnn_neuron_io.bin");
|
|
|
|
printf("OK\n");
|
|
|
|
|
2022-09-28 10:20:08 +02:00
|
|
|
printf("Vérification de l'égalité des réseaux\n");
|
|
|
|
if (! equals_networks(network, network2)) {
|
|
|
|
printf_error("Les deux réseaux obtenus ne sont pas égaux.\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
2022-09-23 14:25:56 +02:00
|
|
|
printf("OK\n");
|
2022-09-28 10:20:08 +02:00
|
|
|
|
2022-09-23 14:25:56 +02:00
|
|
|
return 0;
|
|
|
|
}
|