changing data loading

This commit is contained in:
Joseph Redmon
2015-08-24 18:27:42 -07:00
parent 3a99b8151f
commit 9d42f49a24
21 changed files with 1104 additions and 1231 deletions

View File

@ -11,6 +11,7 @@
#include "convolutional_layer.h"
#include "deconvolutional_layer.h"
#include "detection_layer.h"
#include "region_layer.h"
#include "normalization_layer.h"
#include "maxpool_layer.h"
#include "avgpool_layer.h"
@ -36,6 +37,8 @@ char *get_layer_string(LAYER_TYPE a)
return "softmax";
case DETECTION:
return "detection";
case REGION:
return "region";
case DROPOUT:
return "dropout";
case CROP:
@ -80,6 +83,8 @@ void forward_network(network net, network_state state)
forward_normalization_layer(l, state);
} else if(l.type == DETECTION){
forward_detection_layer(l, state);
} else if(l.type == REGION){
forward_region_layer(l, state);
} else if(l.type == CONNECTED){
forward_connected_layer(l, state);
} else if(l.type == CROP){
@ -130,12 +135,16 @@ float get_network_cost(network net)
float sum = 0;
int count = 0;
for(i = 0; i < net.n; ++i){
if(net.layers[net.n-1].type == COST){
sum += net.layers[net.n-1].output[0];
if(net.layers[i].type == COST){
sum += net.layers[i].output[0];
++count;
}
if(net.layers[net.n-1].type == DETECTION){
sum += net.layers[net.n-1].cost[0];
if(net.layers[i].type == DETECTION){
sum += net.layers[i].cost[0];
++count;
}
if(net.layers[i].type == REGION){
sum += net.layers[i].cost[0];
++count;
}
}
@ -178,6 +187,8 @@ void backward_network(network net, network_state state)
backward_dropout_layer(l, state);
} else if(l.type == DETECTION){
backward_detection_layer(l, state);
} else if(l.type == REGION){
backward_region_layer(l, state);
} else if(l.type == SOFTMAX){
if(i != 0) backward_softmax_layer(l, state);
} else if(l.type == CONNECTED){