diff --git a/Startcode/neuralNetworkTests.c b/Startcode/neuralNetworkTests.c index dab12ab..c1eef28 100644 --- a/Startcode/neuralNetworkTests.c +++ b/Startcode/neuralNetworkTests.c @@ -13,17 +13,17 @@ static void prepareNeuralNetworkFile(const char *path, const NeuralNetwork nn) if (fd == NULL) return; - fwrite(FILE_HEADER_STRING, sizeof(FILE_HEADER_STRING) - 1, 1, fd); + fwrite(FILE_HEADER_STRING, strlen(FILE_HEADER_STRING), 1, fd); // fwrite(&nn, sizeof(nn), 1, fd); fwrite(&(nn.layers[0].weights.cols), sizeof(nn.layers[0].weights.cols), 1, fd); for (int i = 0; i < nn.numberOfLayers; ++i) { fwrite(&(nn.layers[i].weights.rows), sizeof(nn.layers[i].weights.rows), 1, fd); - fwrite(&(nn.layers[i].weights.buffer), sizeof(MatrixType) * nn.layers[i].weights.rows * nn.layers[i].weights.cols, 1, fd); - fwrite(&(nn.layers[i].biases.buffer), sizeof(MatrixType) * nn.layers[i].biases.rows, 1, fd); + fwrite(nn.layers[i].weights.buffer, sizeof(MatrixType), nn.layers[i].weights.rows * nn.layers[i].weights.cols, fd); + fwrite(nn.layers[i].biases.buffer, sizeof(MatrixType), nn.layers[i].biases.rows, fd); } - const float zeroooooo = 0.0F; - fwrite(&zeroooooo, sizeof(MatrixType), 1, fd); + const int zeroooooo = 0; + fwrite(&zeroooooo, sizeof(int), 1, fd); fclose(fd); }