2022-07-05 08:13:25 +02:00
|
|
|
#ifndef DEF_FUNCTION_H
|
|
|
|
#define DEF_FUNCTION_H
|
|
|
|
|
|
|
|
// Les dérivées sont l'opposé
|
|
|
|
#define TANH 1
|
|
|
|
#define SIGMOID 2
|
|
|
|
#define RELU 3
|
|
|
|
#define SOFTMAX 4
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fonction max pour les floats
|
|
|
|
*/
|
|
|
|
float max(float a, float b);
|
|
|
|
|
|
|
|
float sigmoid(float x);
|
|
|
|
|
|
|
|
float sigmoid_derivative(float x);
|
|
|
|
|
|
|
|
float relu(float x);
|
|
|
|
|
|
|
|
float relu_derivative(float x);
|
|
|
|
|
|
|
|
float tanh_(float x);
|
|
|
|
|
|
|
|
float tanh_derivative(float x);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Applique softmax sur ????
|
|
|
|
*/
|
|
|
|
void apply_softmax_input(float ***input, int depth, int rows, int columns);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Applique la fonction f sur ????
|
|
|
|
*/
|
|
|
|
void apply_function_input(float (*f)(float), float*** input, int depth, int rows, int columns);
|
|
|
|
|
|
|
|
/*
|
2022-09-30 15:50:29 +02:00
|
|
|
* Redirige vers la fonction à appliquer sur une matrice
|
2022-07-05 08:13:25 +02:00
|
|
|
*/
|
2022-09-30 15:50:29 +02:00
|
|
|
void choose_apply_function_matrix(int activation, float*** input, int depth, int dim);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Redirige vers la fonction à appliquer sur un vecteur
|
|
|
|
*/
|
|
|
|
void choose_apply_function_vector(int activation, float*** input, int dim);
|
2022-07-05 08:13:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|