2022-10-05 11:20:26 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2023-11-10 23:09:48 +01:00
|
|
|
#include "include/test.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() {
|
2023-11-10 23:09:48 +01:00
|
|
|
_TEST_PRESENTATION("Utilitaires du CNN");
|
|
|
|
|
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);
|
2023-11-10 23:09:48 +01:00
|
|
|
_TEST_ASSERT(true, "Création de réseaux");
|
2022-10-05 11:20:26 +02:00
|
|
|
|
|
|
|
Network* network_cp = copy_network(network);
|
2023-11-10 23:09:48 +01:00
|
|
|
_TEST_ASSERT(true, "Copie de réseau (copy_network)");
|
2022-10-05 11:20:26 +02:00
|
|
|
|
2023-11-10 23:09:48 +01:00
|
|
|
_TEST_ASSERT(equals_networks(network, network_cp), "Égalité du réseau copié (copy_network)");
|
2022-10-05 11:20:26 +02:00
|
|
|
|
2023-02-01 21:15:54 +01:00
|
|
|
copy_network_parameters(network, network2);
|
2023-11-10 23:09:48 +01:00
|
|
|
_TEST_ASSERT(true, "Copie de réseau (copy_network_parameters)");
|
|
|
|
|
|
|
|
_TEST_ASSERT(equals_networks(network, network2), "Égalité du réseau copié (copy_network_parameters)");
|
2023-02-01 21:15:54 +01:00
|
|
|
|
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;
|
|
|
|
}
|