Minor changes

This commit is contained in:
augustin64 2022-10-04 12:43:37 +02:00
parent a29e8a2c0f
commit 1f563f5f23
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,5 @@
#include "struct.h"
#ifndef DEF_TRAIN_H
#define DEF_TRAIN_H

View File

@ -3,6 +3,7 @@
#include <stdint.h>
#include <inttypes.h>
#include "../colors.h"
#include "include/neuron_io.h"
#include "include/struct.h"
@ -254,8 +255,8 @@ Kernel* read_kernel(int type_couche, FILE* ptr) {
nn->weights = (float**)malloc(sizeof(float*)*nn->input_units);
nn->d_weights = (float**)malloc(sizeof(float*)*nn->input_units);
for (int i=0; i < nn->input_units; i++) {
nn->weights[i] = malloc(sizeof(float)*nn->output_units);
nn->d_weights[i] = malloc(sizeof(float)*nn->output_units);
nn->weights[i] = (float*)malloc(sizeof(float)*nn->output_units);
nn->d_weights[i] = (float*)malloc(sizeof(float)*nn->output_units);
for (int j=0; j < nn->output_units; j++) {
fread(&tmp, sizeof(tmp), 1, ptr);
nn->weights[i][j] = tmp;