Fix Kernel size

This commit is contained in:
julienChemillier 2023-01-17 15:25:34 +01:00
parent 00797ab3a8
commit 7fdd869d6e
3 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ Network* create_network(int max_size, float learning_rate, int dropout, int init
network->kernel = (Kernel**)malloc(sizeof(Kernel*)*(max_size-1));
network->width = (int*)malloc(sizeof(int*)*max_size);
network->depth = (int*)malloc(sizeof(int*)*max_size);
for (int i=0; i < max_size; i++) {
for (int i=0; i < max_size-1; i++) {
network->kernel[i] = (Kernel*)malloc(sizeof(Kernel));
}
network->width[0] = input_dim;

View File

@ -101,7 +101,7 @@ void free_dense_linearisation(Network* network, int pos) {
void free_network_creation(Network* network) {
free_a_cube_input_layer(network, 0, network->depth[0], network->width[0]);
for (int i=0; i<network->max_size; i++)
for (int i=0; i < network->max_size-1; i++)
free(network->kernel[i]);
free(network->width);
free(network->depth);

View File

@ -17,7 +17,7 @@ int main() {
printf(GREEN "OK\n" RESET);
printf("Architecture LeNet5:\n");
for (int i=0; i < network->size; i++) {
for (int i=0; i < network->size-1; i++) {
kernel = network->kernel[i];
if ((!kernel->cnn)&&(!kernel->nn)) {
printf("\n==== Couche %d de type "YELLOW"Pooling"RESET" ====\n", i);