Added COCO, fixed memory leaks

This commit is contained in:
Joseph Redmon
2015-07-30 16:19:14 -07:00
parent 98813ad520
commit 846b3b4366
10 changed files with 359 additions and 22 deletions

View File

@@ -242,6 +242,19 @@ void rgbgr_filters(convolutional_layer l)
}
}
void rescale_filters(convolutional_layer l, float scale, float trans)
{
int i;
for(i = 0; i < l.n; ++i){
image im = get_convolutional_filter(l, i);
if (im.c == 3) {
scale_image(im, scale);
float sum = sum_array(im.data, im.w*im.h*im.c);
l.biases[i] += sum*trans;
}
}
}
image *get_filters(convolutional_layer l)
{
image *filters = calloc(l.n, sizeof(image));