tipe/src/cnn/include/struct.h

48 lines
2.1 KiB
C
Raw Normal View History

2022-07-05 08:13:25 +02:00
#ifndef DEF_STRUCT_H
#define DEF_STRUCT_H
typedef struct Kernel_cnn {
int k_size;
2022-09-16 14:36:50 +02:00
int rows; // Depth of the input
int columns; // Depth of the output
float*** bias; // bias[columns][k_size][k_size]
float*** d_bias; // d_bias[columns][k_size][k_size]
2022-10-08 14:13:02 +02:00
float*** last_d_bias; // last_d_bias[columns][k_size][k_size]
2022-09-16 14:36:50 +02:00
float**** w; // w[rows][columns][k_size][k_size]
2022-10-08 14:13:02 +02:00
float**** d_w; // d_w[rows][columns][k_size][k_size]
float**** last_d_w; // last_d_w[rows][columns][k_size][k_size]
2022-07-05 08:13:25 +02:00
} Kernel_cnn;
typedef struct Kernel_nn {
2022-09-12 17:56:44 +02:00
int input_units; // Nombre d'éléments en entrée
2022-09-16 14:36:50 +02:00
int output_units; // Nombre d'éléments en sortie
float* bias; // bias[output_units]
float* d_bias; // d_bias[output_units]
2022-10-08 14:13:02 +02:00
float* last_d_bias; // last_d_bias[output_units]
2022-09-16 14:36:50 +02:00
float** weights; // weight[input_units][output_units]
float** d_weights; // d_weights[input_units][output_units]
2022-10-08 14:13:02 +02:00
float** last_d_weights; // last_d_weights[input_units][output_units]
2022-07-05 08:13:25 +02:00
} Kernel_nn;
typedef struct Kernel {
2022-09-16 14:36:50 +02:00
Kernel_cnn* cnn; // NULL si ce n'est pas un cnn
Kernel_nn* nn; // NULL si ce n'est pas un nn
2022-09-19 18:39:49 +02:00
int activation; // Vaut l'activation sauf pour un pooling où il: vaut pooling_size*100 + activation
int linearisation; // Vaut 1 si c'est la linéarisation d'une couche, 0 sinon ?? Ajouter dans les autres
2022-07-05 08:13:25 +02:00
} Kernel;
typedef struct Network{
2022-09-16 14:36:50 +02:00
int dropout; // Contient la probabilité d'abandon d'un neurone dans [0, 100] (entiers)
2022-10-05 11:20:26 +02:00
int learning_rate; // Taux d'apprentissage du réseau
2022-07-05 08:13:25 +02:00
int initialisation; // Contient le type d'initialisation
2022-09-16 14:36:50 +02:00
int max_size; // Taille du tableau contenant le réseau
int size; // Taille actuelle du réseau (size ≤ max_size)
int* width; // width[size]
int* depth; // depth[size]
2022-10-05 11:20:26 +02:00
Kernel** kernel; // kernel[size], contient tous les kernels
float**** input; // Tableau de toutes les couches du réseau input[size][couche->depth][couche->width][couche->width]
2022-10-31 20:08:42 +01:00
float**** input_z; // Même tableau que input mais ne contient paas la dernière fonction d'activation à chaque ligne
2022-07-05 08:13:25 +02:00
} Network;
#endif