Change fully_connected to dense

This commit is contained in:
julienChemillier 2023-02-17 14:56:05 +01:00
parent 98290092dc
commit 3f9114c245
5 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ $\dfrac{\partial E}{\partial b_i} = \dfrac{\partial E}{\partial a_i}$
## Backpropagation of a fully connected layer
<img src="fully_connected.png" width="200">
<img src="dense.png" width="200">
Soit f la fonction d'activation de la première couche (qui transforme les $a_i$ en $l_i$) et g la fonction d'activation de la deuxième couche (qui transforme les $c_i$ en $d_i$).
- $d_1 =g(c_1)$

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

@ -46,7 +46,7 @@ void backward_2d_pooling(float*** input, float*** output, int input_width, int o
}
}
void backward_fully_connected(Kernel_nn* ker, float* input, float* input_z, float* output, int size_input, int size_output, ptr d_function, int is_first) {
void backward_dense(Kernel_nn* ker, float* input, float* input_z, float* output, int size_input, int size_output, ptr d_function, int is_first) {
// Bias
for (int j=0; j < size_output; j++) {
ker->d_bias[j] += output[j];

View File

@ -163,7 +163,7 @@ void backward_propagation(Network* network, int wanted_number) {
} else if (k_i->nn) { // Full connection
ptr d_f = get_function_activation(activation);
if (k_i->linearisation == 0) { // Vecteur -> Vecteur
backward_fully_connected(k_i->nn, input[0][0], input_z[0][0], output[0][0], input_width, output_width, d_f, i==0);
backward_dense(k_i->nn, input[0][0], input_z[0][0], output[0][0], input_width, output_width, d_f, i==0);
} else { // Matrice -> vecteur
backward_linearisation(k_i->nn, input, input_z, output[0][0], input_depth, input_width, output_width, d_f);
}

View File

@ -27,7 +27,7 @@ void backward_2d_pooling(float*** input, float*** output, int input_width, int o
/*
* Transfert les informations d'erreur à travers une couche fully connected
*/
void backward_fully_connected(Kernel_nn* ker, float* input, float* input_z, float* output, int size_input, int size_output, ptr d_function, int is_first);
void backward_dense(Kernel_nn* ker, float* input, float* input_z, float* output, int size_input, int size_output, ptr d_function, int is_first);
/*
* Transfert les informations d'erreur à travers une couche de linéarisation