-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathneural-network.h
More file actions
39 lines (24 loc) · 1.16 KB
/
neural-network.h
File metadata and controls
39 lines (24 loc) · 1.16 KB
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
32
33
34
35
36
37
38
39
#pragma once
#include <stdarg.h>
#include "layer.h"
typedef struct neural_network{
int in_size;
int out_size;
int num_layers;
Layer* layers;
int image_height;
int image_width;
int num_con_layers;
Convolution* con_layers;
} Network;
unsigned short init_Network(int image_height, int image_width, Network* network, int size1, ...);
unsigned short set_Convolutions(Network* network, int filter_size);
unsigned short write_Network(Network* network, char filename[]);
unsigned short extract_Network(Network* network, char filename[]);
parameter* calculate_output(Network* network, char* input);
void print_network_sizes(Network* network);
void learn_individual(Network* network, char* training_image, parameter* expected);
void learn_batch(Network* network, char** training_images, parameter** expected_outputs, parameter learn_rate, int batch_size);
void learn_batch_slow(Network* network, char** training_images, parameter** expected_outputs, parameter learn_rate, int batch_size);
float cost_average(Network* network, char** test_images, parameter** expected_outputs, unsigned int num_images);
float cost(parameter* prediction, parameter* expected, int num_outputs);