tipe/src/cnn/include/struct.h

43 lines
1.6 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]
float**** w; // w[rows][columns][k_size][k_size]
float**** d_w; // dw[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]
float** weights; // weight[input_units][output_units]
float** d_weights; // 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-03 10:04:11 +02:00
int learning_rate;
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]
Kernel** kernel; // Tableau de tous les kernels
float**** input; // Tableau de toutes les couches du réseau input[nb couches][couche->depth][couche->dim][couche->dim]
2022-07-05 08:13:25 +02:00
} Network;
#endif