2022-10-05 11:20:26 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2023-05-12 16:16:34 +02:00
|
|
|
#include "../src/common/include/colors.h"
|
2022-10-24 12:54:51 +02:00
|
|
|
#include "../src/cnn/include/creation.h"
|
2023-05-15 18:25:29 +02:00
|
|
|
#include "../src/cnn/include/models.h"
|
2022-10-24 12:54:51 +02:00
|
|
|
#include "../src/cnn/include/utils.h"
|
2022-11-23 10:41:19 +01:00
|
|
|
#include "../src/cnn/include/free.h"
|
2022-10-05 11:20:26 +02:00
|
|
|
|
|
|
|
int main() {
|
|
|
|
printf("Création du réseau\n");
|
2023-05-26 20:46:58 +02:00
|
|
|
Network* network = create_network_lenet5(0, 0, 3, 2, 32, 1, 0);
|
|
|
|
Network* network2 = create_network_lenet5(0, 0, 3, 2, 32, 1, 0);
|
2022-11-11 11:20:30 +01:00
|
|
|
printf(GREEN "OK\n" RESET);
|
2022-10-05 11:20:26 +02:00
|
|
|
|
2023-02-01 21:15:54 +01:00
|
|
|
printf("Copie du réseau via copy_network\n");
|
2022-10-05 11:20:26 +02:00
|
|
|
Network* network_cp = copy_network(network);
|
2022-11-11 11:20:30 +01:00
|
|
|
printf(GREEN "OK\n" RESET);
|
2022-10-05 11:20:26 +02:00
|
|
|
|
|
|
|
printf("Vérification de l'égalité des réseaux\n");
|
|
|
|
if (! equals_networks(network, network_cp)) {
|
2022-11-11 11:20:30 +01:00
|
|
|
printf_error(RED "Les deux réseaux obtenus ne sont pas égaux.\n" RESET);
|
2022-10-05 11:20:26 +02:00
|
|
|
exit(1);
|
|
|
|
}
|
2022-11-11 11:20:30 +01:00
|
|
|
printf(GREEN "OK\n" RESET);
|
2022-10-05 11:20:26 +02:00
|
|
|
|
2023-02-01 21:15:54 +01:00
|
|
|
printf("Copie du réseau via copy_network_parameters\n");
|
|
|
|
copy_network_parameters(network, network2);
|
|
|
|
printf(GREEN "OK\n" RESET);
|
|
|
|
|
|
|
|
printf("Vérification de l'égalité des réseaux\n");
|
|
|
|
if (! equals_networks(network, network2)) {
|
|
|
|
printf_error(RED "Les deux réseaux obtenus ne sont pas égaux.\n" RESET);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
printf(GREEN "OK\n" RESET);
|
|
|
|
|
2022-11-23 10:41:19 +01:00
|
|
|
free_network(network_cp);
|
2023-02-01 21:15:54 +01:00
|
|
|
free_network(network2);
|
2022-11-23 10:41:19 +01:00
|
|
|
free_network(network);
|
2022-10-05 11:20:26 +02:00
|
|
|
return 0;
|
|
|
|
}
|