2022-09-23 14:25:56 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2022-09-28 10:20:08 +02:00
|
|
|
#include "../src/colors.h"
|
2022-09-23 14:25:56 +02:00
|
|
|
#include "../src/cnn/neuron_io.c"
|
|
|
|
#include "../src/cnn/creation.c"
|
2022-09-28 12:43:34 +02:00
|
|
|
#include "../src/cnn/utils.c"
|
2022-09-23 14:25:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
printf("Création du réseau\n");
|
|
|
|
Network* network = create_network_lenet5(0, 3, 2);
|
|
|
|
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;
|
|
|
|
}
|