mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 15:16:26 +01:00
Change fully_connected to dense
This commit is contained in:
parent
98290092dc
commit
3f9114c245
@ -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)$
|
||||
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
@ -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];
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user