| | |
| | | #define NETWORK_H |
| | | |
| | | #include "image.h" |
| | | #include "detection_layer.h" |
| | | #include "layer.h" |
| | | #include "data.h" |
| | | |
| | |
| | | CONSTANT, STEP, EXP, POLY, STEPS, SIG |
| | | } learning_rate_policy; |
| | | |
| | | typedef struct { |
| | | typedef struct network{ |
| | | int n; |
| | | int batch; |
| | | int *seen; |
| | |
| | | float gamma; |
| | | float scale; |
| | | float power; |
| | | int time_steps; |
| | | int step; |
| | | int max_batches; |
| | | float *scales; |
| | |
| | | |
| | | int inputs; |
| | | int h, w, c; |
| | | int max_crop; |
| | | int min_crop; |
| | | |
| | | #ifdef GPU |
| | | float **input_gpu; |
| | |
| | | #endif |
| | | } network; |
| | | |
| | | typedef struct network_state { |
| | | float *truth; |
| | | float *input; |
| | | float *delta; |
| | | int train; |
| | | int index; |
| | | network net; |
| | | } network_state; |
| | | |
| | | #ifdef GPU |
| | | float train_network_datum_gpu(network net, float *x, float *y); |
| | | float *network_predict_gpu(network net, float *input); |
| | |
| | | float train_network(network net, data d); |
| | | float train_network_batch(network net, data d, int n); |
| | | float train_network_sgd(network net, data d, int n); |
| | | float train_network_datum(network net, float *x, float *y); |
| | | |
| | | matrix network_predict_data(network net, data test); |
| | | float *network_predict(network net, float *input); |