From 3c611d5681d121d2e006d1c3ef38251d0c1ea036 Mon Sep 17 00:00:00 2001 From: julienChemillier Date: Sun, 15 Jan 2023 17:51:02 +0100 Subject: [PATCH] Fix size of network->kernel --- src/cnn/creation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cnn/creation.c b/src/cnn/creation.c index 234f889..d071a3c 100644 --- a/src/cnn/creation.c +++ b/src/cnn/creation.c @@ -18,7 +18,7 @@ Network* create_network(int max_size, float learning_rate, int dropout, int init network->size = 1; network->input = (float****)malloc(sizeof(float***)*max_size); network->input_z = (float****)malloc(sizeof(float***)*max_size); - network->kernel = (Kernel**)malloc(sizeof(Kernel*)*max_size); + 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++) {