| | |
| | | #ifndef NETWORK_H |
| | | #define NETWORK_H |
| | | |
| | | #include "image.h" |
| | | #include <stdint.h> |
| | | #include "layer.h" |
| | | |
| | | #ifdef __cplusplus |
| | | extern "C" { |
| | | #endif |
| | | |
| | | #include "image.h" |
| | | #include "data.h" |
| | | #include "tree.h" |
| | | |
| | | typedef enum { |
| | | CONSTANT, STEP, EXP, POLY, STEPS, SIG, RANDOM |
| | | } learning_rate_policy; |
| | | |
| | | typedef struct network{ |
| | | float *workspace; |
| | | int n; |
| | | int batch; |
| | | int *seen; |
| | | int *seen; |
| | | float epoch; |
| | | int subdivisions; |
| | | float momentum; |
| | |
| | | float *scales; |
| | | int *steps; |
| | | int num_steps; |
| | | int burn_in; |
| | | |
| | | int adam; |
| | | float B1; |
| | | float B2; |
| | | float eps; |
| | | |
| | | int inputs; |
| | | int h, w, c; |
| | | int max_crop; |
| | | int min_crop; |
| | | float angle; |
| | | float aspect; |
| | | float exposure; |
| | | float saturation; |
| | | float hue; |
| | | |
| | | int gpu_index; |
| | | tree *hierarchy; |
| | | |
| | | #ifdef GPU |
| | | float **input_gpu; |
| | | float **truth_gpu; |
| | | int wait_stream; |
| | | #endif |
| | | } network; |
| | | |
| | |
| | | float *truth; |
| | | float *input; |
| | | float *delta; |
| | | float *workspace; |
| | | int train; |
| | | int index; |
| | | network net; |
| | | } network_state; |
| | | |
| | | #ifdef GPU |
| | | float train_networks(network *nets, int n, data d, int interval); |
| | | void sync_nets(network *nets, int n, int interval); |
| | | float train_network_datum_gpu(network net, float *x, float *y); |
| | | float *network_predict_gpu(network net, float *input); |
| | | float * get_network_output_gpu_layer(network net, int i); |
| | |
| | | int get_network_nuisance(network net); |
| | | int get_network_background(network net); |
| | | |
| | | #ifdef __cplusplus |
| | | } |
| | | #endif |
| | | |
| | | #endif |
| | | |