tipe/src/cnn/include/initialisation.h

32 lines
1.1 KiB
C
Raw Normal View History

2022-07-05 08:13:25 +02:00
#ifndef DEF_INITIALISATION_H
#define DEF_INITIALISATION_H
2023-01-13 15:58:26 +01:00
// Génère un flottant entre 0 et 1
2022-07-05 08:13:25 +02:00
#define RAND_FLT() ((float)rand())/((float)RAND_MAX)
#define ZERO 0
2022-11-04 10:54:32 +01:00
#define GLOROT 1
#define XAVIER 1 // Xavier and Glorot initialisations are the same
#define HE 2
2022-07-05 08:13:25 +02:00
/*
2022-11-04 10:54:32 +01:00
* Initialise une matrice 1d dim de float en fonction du type d'initialisation
2022-07-05 08:13:25 +02:00
*/
void initialisation_1d_matrix(int initialisation, float* matrix, int dim, int n_in);
2022-07-05 08:13:25 +02:00
/*
2022-11-04 10:54:32 +01:00
* Initialise une matrice 2d dim1*dim2 de float en fonction du type d'initialisation
2022-07-05 08:13:25 +02:00
*/
2022-11-04 10:54:32 +01:00
void initialisation_2d_matrix(int initialisation, float** matrix, int dim1, int dim2, int n_in, int n_out);
2022-07-05 08:13:25 +02:00
/*
2022-11-04 10:54:32 +01:00
* Initialise une matrice 3d depth*dim1*dim2 de float en fonction du type d'initialisation
2022-07-05 08:13:25 +02:00
*/
2022-11-04 10:54:32 +01:00
void initialisation_3d_matrix(int initialisation, float*** matrix, int depth, int dim1, int dim2, int n_in, int n_out);
2022-07-05 08:13:25 +02:00
/*
2022-11-04 10:54:32 +01:00
* Initialise une matrice 4d depth1*depth2*dim1*dim2 de float en fonction du type d'initialisation
2022-07-05 08:13:25 +02:00
*/
2022-11-04 10:54:32 +01:00
void initialisation_4d_matrix(int initialisation, float**** matrix, int depth1, int depth2, int dim1, int dim2, int n_in, int n_out);
2022-07-05 08:13:25 +02:00
#endif