forked from freudenreichan/info2Praktikum-NeuronalesNetz
Compare commits
1
Commits
imageinput
...
nntest
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48a4cff14a |
@@ -8,7 +8,26 @@
|
|||||||
|
|
||||||
static void prepareNeuralNetworkFile(const char *path, const NeuralNetwork nn)
|
static void prepareNeuralNetworkFile(const char *path, const NeuralNetwork nn)
|
||||||
{
|
{
|
||||||
// TODO
|
FILE *file = fopen(path, "wb");
|
||||||
|
|
||||||
|
if(file != NULL)
|
||||||
|
{
|
||||||
|
const char *fileTag = "__info2_neural_network_file_format__";
|
||||||
|
|
||||||
|
if(zeroBuffer != NULL)
|
||||||
|
{
|
||||||
|
fwrite(fileTag, sizeof(fileTag[0]), strlen(fileTag), file);
|
||||||
|
|
||||||
|
for(int i = 0; i < nn->numberOfLayers; i++)
|
||||||
|
{
|
||||||
|
fwrite(nn->layers[i].weights, sizeof(nn->layers[i].weights), 1, file);
|
||||||
|
fwrite(nn->layers[i].biases, sizeof(nn->layers[i].biases), 1, file);
|
||||||
|
fwrite(nn->layers[i].activation, sizeof(nn->layers[i].activation), 1, file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_loadModelReturnsCorrectNumberOfLayers(void)
|
void test_loadModelReturnsCorrectNumberOfLayers(void)
|
||||||
|
|||||||
Reference in new issue
Block a user