Change 'input_size' to 'size_input'

This commit is contained in:
julienChemillier 2023-02-19 13:43:09 +01:00
parent c13772c291
commit 1d462576a9
2 changed files with 9 additions and 9 deletions

View File

@ -52,16 +52,16 @@ void write_image_in_network_32(int** image, int height, int width, float** input
}
void write_image_in_network_260(unsigned char* image, int height, int width, float*** input) {
int input_size = 260;
int padding = (input_size - height)/2;
int size_input = 260;
int padding = (size_input - height)/2;
for (int i=0; i < padding; i++) {
for (int j=0; j < input_size; j++) {
for (int j=0; j < size_input; j++) {
for (int composante=0; composante < 3; composante++) {
input[composante][i][j] = 0.;
input[composante][input_size-1-i][j] = 0.;
input[composante][size_input-1-i][j] = 0.;
input[composante][j][i] = 0.;
input[composante][j][input_size-1-i] = 0.;
input[composante][j][size_input-1-i] = 0.;
}
}
}

View File

@ -48,8 +48,8 @@ void update_weights(Network* network, Network* d_network) {
} else { // Matrice -> vecteur
Kernel_nn* nn = k_i->nn;
Kernel_nn* d_nn = dk_i->nn;
int input_size = input_width*input_width*input_depth;
for (int a=0; a<input_size; a++) {
int size_input = input_width*input_width*input_depth;
for (int a=0; a<size_input; a++) {
for (int b=0; b<output_width; b++) {
nn->weights[a][b] -= network->learning_rate * d_nn->d_weights[a][b];
d_nn->d_weights[a][b] = 0;
@ -148,8 +148,8 @@ void reset_d_weights(Network* network) {
}
} else { // Matrice -> vecteur
Kernel_nn* nn = k_i_1->nn;
int input_size = input_width*input_width*input_depth;
for (int a=0; a<input_size; a++) {
int size_input = input_width*input_width*input_depth;
for (int a=0; a<size_input; a++) {
for (int b=0; b<output_width; b++) {
nn->d_weights[a][b] = 0;
}