-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
31 lines (27 loc) · 834 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <math.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include "utilidades/img.h"
#include "neurona/activations.h"
#include "neurona/nn.h"
#include "matriz/matrix.h"
#include "matriz/ops.h"
int main() {
srand(time(NULL));
// ENTRENAMIENTO
int number_imgs = 10000;
Img** imgs = csv_to_imgs("data/mnist_train.csv", number_imgs);
NeuralNetwork* net = network_create(784, 300, 10, 0.1);
network_train_batch_imgs(net, imgs, number_imgs);
network_save(net, "testeo_neuronal");
// // PREDICCIÓN
// int number_imgs = 3000;
// Img** imgs = csv_to_imgs("data/mnist_train.csv", number_imgs);
// NeuralNetwork* net = network_load("testeo_neuronal");
// double score = network_predict_imgs(net, imgs, 1000);
// printf("Score: %1.5f \n", score);
imgs_free(imgs, number_imgs);
network_free(net);
return 0;
}