mirror of
https://github.com/augustin64/projet-tipe
synced 2025-02-02 19:39:39 +01:00
Add debug statements
This commit is contained in:
parent
ad00b873b4
commit
be8f1bb5cb
@ -100,6 +100,6 @@ void free_network_lenet5(Network* network) {
|
||||
free_convolution(network, 0);
|
||||
free_network_creation(network);
|
||||
if (network->size != network->max_size) {
|
||||
printf("Attention, le réseau LeNet5 n'est pas complet");
|
||||
printf("033[33;1m[WARNING]\033[0m Le réseau LeNet5 est incomplet");
|
||||
}
|
||||
}
|
||||
|
@ -13,21 +13,21 @@
|
||||
/*
|
||||
* Initialise une matrice 1d rows de float en fonction du type d'initialisation
|
||||
*/
|
||||
void initialisation_1d_matrix(int initialisation, float* matrix, int rows, int n); //NOT FINISHED (UNIFORM AND VARIATIONS)
|
||||
void initialisation_1d_matrix(int initialisation, float* matrix, int rows, int n); // TODO (UNIFORM AND VARIATIONS)
|
||||
|
||||
/*
|
||||
* Initialise une matrice 2d rows*columns de float en fonction du type d'initialisation
|
||||
*/
|
||||
void initialisation_2d_matrix(int initialisation, float** matrix, int rows, int columns, int n); //NOT FINISHED
|
||||
void initialisation_2d_matrix(int initialisation, float** matrix, int rows, int columns, int n); // TODO
|
||||
|
||||
/*
|
||||
* Initialise une matrice 3d depth*dim*columns de float en fonction du type d'initialisation
|
||||
*/
|
||||
void initialisation_3d_matrix(int initialisation, float*** matrix, int depth, int rows, int columns, int n); //NOT FINISHED
|
||||
void initialisation_3d_matrix(int initialisation, float*** matrix, int depth, int rows, int columns, int n); // TODO
|
||||
|
||||
/*
|
||||
* Initialise une matrice 4d rows*columns*rows1*columns1 de float en fonction du type d'initialisation
|
||||
*/
|
||||
void initialisation_4d_matrix(int initialisation, float**** matrix, int rows, int columns, int rows1, int columns1, int n); //NOT FINISHED
|
||||
void initialisation_4d_matrix(int initialisation, float**** matrix, int rows, int columns, int rows1, int columns1, int n); // TODO
|
||||
|
||||
#endif
|
@ -22,7 +22,7 @@ void forward_propagation(Network* network);
|
||||
/*
|
||||
* Propage en arrière le cnn
|
||||
*/
|
||||
void backward_propagation(Network* network, float wanted_number); //NOT FINISHED
|
||||
void backward_propagation(Network* network, float wanted_number); // TODO
|
||||
|
||||
/*
|
||||
* Renvoie l'erreur du réseau neuronal pour une sortie
|
||||
|
@ -3,7 +3,8 @@
|
||||
#include "include/initialisation.h"
|
||||
|
||||
|
||||
void initialisation_1d_matrix(int initialisation, float* matrix, int rows, int n) { //NOT FINISHED
|
||||
void initialisation_1d_matrix(int initialisation, float* matrix, int rows, int n) { // TODO
|
||||
printf("\033[33;1m[WARNING]\033[0m Appel de initialisation_1d_matrix, incomplet\n");
|
||||
float lower_bound = -6/sqrt((double)n);
|
||||
float distance = -lower_bound-lower_bound;
|
||||
for (int i=0; i < rows; i++) {
|
||||
@ -11,7 +12,8 @@ void initialisation_1d_matrix(int initialisation, float* matrix, int rows, int n
|
||||
}
|
||||
}
|
||||
|
||||
void initialisation_2d_matrix(int initialisation, float** matrix, int rows, int columns, int n) { //NOT FINISHED
|
||||
void initialisation_2d_matrix(int initialisation, float** matrix, int rows, int columns, int n) { // TODO
|
||||
printf("\033[33;1m[WARNING]\033[0m Appel de initialisation_2d_matrix, incomplet\n");
|
||||
float lower_bound = -6/sqrt((double)n);
|
||||
float distance = -lower_bound-lower_bound;
|
||||
for (int i=0; i < rows; i++) {
|
||||
@ -21,7 +23,8 @@ void initialisation_2d_matrix(int initialisation, float** matrix, int rows, int
|
||||
}
|
||||
}
|
||||
|
||||
void initialisation_3d_matrix(int initialisation, float*** matrix, int depth, int rows, int columns, int n) { //NOT FINISHED
|
||||
void initialisation_3d_matrix(int initialisation, float*** matrix, int depth, int rows, int columns, int n) { // TODO
|
||||
printf("\033[33;1m[WARNING]\033[0m Appel de initialisation_3d_matrix, incomplet\n");
|
||||
float lower_bound = -6/sqrt((double)n);
|
||||
float distance = -lower_bound-lower_bound;
|
||||
for (int i=0; i < depth; i++) {
|
||||
@ -33,7 +36,8 @@ void initialisation_3d_matrix(int initialisation, float*** matrix, int depth, in
|
||||
}
|
||||
}
|
||||
|
||||
void initialisation_4d_matrix(int initialisation, float**** matrix, int rows, int columns, int rows1, int columns1, int n) { //NOT FINISHED
|
||||
void initialisation_4d_matrix(int initialisation, float**** matrix, int rows, int columns, int rows1, int columns1, int n) { // TODO
|
||||
printf("\033[33;1m[WARNING]\033[0m Appel de initialisation_4d_matrix, incomplet\n");
|
||||
float lower_bound = -6/sqrt((double)n);
|
||||
float distance = -lower_bound-lower_bound;
|
||||
for (int i=0; i < rows; i++) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
#include "initialisation.c"
|
||||
#include "include/initialisation.h"
|
||||
#include "function.c"
|
||||
#include "creation.c"
|
||||
#include "make.c"
|
||||
@ -78,7 +78,8 @@ void forward_propagation(Network* network) {
|
||||
}
|
||||
}
|
||||
|
||||
void backward_propagation(Network* network, float wanted_number) {
|
||||
void backward_propagation(Network* network, float wanted_number) { // TODO
|
||||
printf("\033[33;1m[WARNING]\033[0m Appel de backward_propagation, incomplet\n");
|
||||
float* wanted_output = generate_wanted_output(wanted_number);
|
||||
int n = network->size-1;
|
||||
float loss = compute_cross_entropy_loss(network->input[n][0][0], wanted_output, network->width[n]);
|
||||
|
@ -2,7 +2,8 @@
|
||||
#include "include/make.h"
|
||||
|
||||
void make_convolution(float*** input, Kernel_cnn* kernel, float*** output, int output_dim) {
|
||||
//NOT FINISHED, MISS CONDITIONS ON THE CONVOLUTION
|
||||
// TODO, MISS CONDITIONS ON THE CONVOLUTION
|
||||
printf("\033[33;1m[WARNING]\033[0m Appel de make_convolution, incomplet\n");
|
||||
float f;
|
||||
int n = kernel->k_size;
|
||||
printf("Convolution output: %dx%dx%d, %dx%dx%d\n", kernel->columns, output_dim, output_dim, kernel->rows, n, n);
|
||||
@ -25,7 +26,8 @@ void make_convolution(float*** input, Kernel_cnn* kernel, float*** output, int o
|
||||
}
|
||||
|
||||
void make_average_pooling(float*** input, float*** output, int size, int output_depth, int output_dim) {
|
||||
//NOT FINISHED, MISS CONDITIONS ON THE POOLING
|
||||
// TODO, MISS CONDITIONS ON THE POOLING
|
||||
printf("\033[33;1m[WARNING]\033[0m Appel de make_average_pooling, incomplet\n");
|
||||
float average;
|
||||
int n = size*size;
|
||||
for (int i=0; i < output_depth; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user