This commit is contained in:
Joseph Redmon
2014-11-28 10:38:26 -08:00
parent e36182cd8c
commit b77a8f3987
7 changed files with 114 additions and 11 deletions

View File

@ -2,17 +2,24 @@
#define COST_LAYER_H
#include "opencl.h"
typedef enum{
SSE, DETECTION
} COST_TYPE;
typedef struct {
int inputs;
int batch;
float *delta;
float *output;
COST_TYPE type;
#ifdef GPU
cl_mem delta_cl;
#endif
} cost_layer;
cost_layer *make_cost_layer(int batch, int inputs);
COST_TYPE get_cost_type(char *s);
char *get_cost_string(COST_TYPE a);
cost_layer *make_cost_layer(int batch, int inputs, COST_TYPE type);
void forward_cost_layer(const cost_layer layer, float *input, float *truth);
void backward_cost_layer(const cost_layer layer, float *input, float *delta);