darknet/src/network.h

49 lines
1.5 KiB
C
Raw Normal View History

2013-11-04 23:11:01 +04:00
// Oh boy, why am I about to do this....
#ifndef NETWORK_H
#define NETWORK_H
#include "image.h"
2013-11-13 22:50:38 +04:00
#include "data.h"
2013-11-04 23:11:01 +04:00
typedef enum {
CONVOLUTIONAL,
CONNECTED,
2013-12-03 04:41:40 +04:00
MAXPOOL,
SOFTMAX
2013-11-04 23:11:01 +04:00
} LAYER_TYPE;
typedef struct {
int n;
2014-03-13 08:57:34 +04:00
int batch;
2013-11-04 23:11:01 +04:00
void **layers;
LAYER_TYPE *types;
2013-12-07 01:26:09 +04:00
int outputs;
float *output;
2013-11-04 23:11:01 +04:00
} network;
2014-03-13 08:57:34 +04:00
network make_network(int n, int batch);
void forward_network(network net, float *input);
float backward_network(network net, float *input, float *truth);
void update_network(network net, float step, float momentum, float decay);
float train_network_sgd(network net, data d, int n, float step, float momentum,float decay);
float train_network_batch(network net, data d, int n, float step, float momentum,float decay);
void train_network(network net, data d, float step, float momentum, float decay);
2013-12-07 21:38:50 +04:00
matrix network_predict_data(network net, data test);
float network_accuracy(network net, data d);
float *get_network_output(network net);
float *get_network_output_layer(network net, int i);
float *get_network_delta_layer(network net, int i);
float *get_network_delta(network net);
int get_network_output_size_layer(network net, int i);
2013-11-13 22:50:38 +04:00
int get_network_output_size(network net);
2013-11-04 23:11:01 +04:00
image get_network_image(network net);
image get_network_image_layer(network net, int i);
2013-12-07 01:26:09 +04:00
int get_predicted_class_network(network net);
2013-12-03 04:41:40 +04:00
void print_network(network net);
void visualize_network(network net);
2014-02-14 22:26:31 +04:00
void save_network(network net, char *filename);
2014-03-13 08:57:34 +04:00
int resize_network(network net, int h, int w, int c);
2013-11-04 23:11:01 +04:00
#endif