mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 23:26:25 +01:00
Fix Mutlithreading issue with pooling
This commit is contained in:
parent
7b02a0e8fd
commit
ae9d72a6eb
@ -87,7 +87,7 @@ void backward_linearisation(Kernel_nn* ker, float*** input, float*** input_z, fl
|
|||||||
for (int k=0; k < dim_input; k++) {
|
for (int k=0; k < dim_input; k++) {
|
||||||
for (int l=0; l < dim_input; l++) {
|
for (int l=0; l < dim_input; l++) {
|
||||||
for (int j=0; j < size_output; j++) {
|
for (int j=0; j < size_output; j++) {
|
||||||
ker->d_weights[cpt][j] += input[i][k][l]*output[j]/(depth_input*dim_input*dim_input*size_output);
|
ker->d_weights[cpt][j] += input[i][k][l]*output[j]/nb_elem;
|
||||||
}
|
}
|
||||||
cpt++;
|
cpt++;
|
||||||
}
|
}
|
||||||
|
@ -124,12 +124,14 @@ Network* copy_network(Network* network) {
|
|||||||
for (int i=0; i < size-1; i++) {
|
for (int i=0; i < size-1; i++) {
|
||||||
network_cp->kernel[i] = (Kernel*)nalloc(sizeof(Kernel));
|
network_cp->kernel[i] = (Kernel*)nalloc(sizeof(Kernel));
|
||||||
if (!network->kernel[i]->nn && !network->kernel[i]->cnn) { // Cas de la couche de linéarisation
|
if (!network->kernel[i]->nn && !network->kernel[i]->cnn) { // Cas de la couche de linéarisation
|
||||||
|
copyVar(kernel[i]->pooling);
|
||||||
copyVar(kernel[i]->activation);
|
copyVar(kernel[i]->activation);
|
||||||
copyVar(kernel[i]->linearisation); // 1
|
copyVar(kernel[i]->linearisation); // 1
|
||||||
network_cp->kernel[i]->cnn = NULL;
|
network_cp->kernel[i]->cnn = NULL;
|
||||||
network_cp->kernel[i]->nn = NULL;
|
network_cp->kernel[i]->nn = NULL;
|
||||||
}
|
}
|
||||||
else if (!network->kernel[i]->cnn) { // Cas du NN
|
else if (!network->kernel[i]->cnn) { // Cas du NN
|
||||||
|
copyVar(kernel[i]->pooling);
|
||||||
copyVar(kernel[i]->activation);
|
copyVar(kernel[i]->activation);
|
||||||
copyVar(kernel[i]->linearisation); // 0
|
copyVar(kernel[i]->linearisation); // 0
|
||||||
|
|
||||||
@ -161,6 +163,7 @@ Network* copy_network(Network* network) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // Cas du CNN
|
else { // Cas du CNN
|
||||||
|
copyVar(kernel[i]->pooling);
|
||||||
copyVar(kernel[i]->activation);
|
copyVar(kernel[i]->activation);
|
||||||
copyVar(kernel[i]->linearisation); // 0
|
copyVar(kernel[i]->linearisation); // 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user