void rgbgr_weights(convolutional_layer l) { int i; for(i = 0; i < l.n; ++i){ image im = get_convolutional_weight(l, i); if (im.c == 3) { rgbgr_image(im); } } }
image *get_weights(convolutional_layer l) { image *weights = calloc(l.n, sizeof(image)); int i; for(i = 0; i < l.n; ++i){ weights[i] = copy_image(get_convolutional_weight(l, i)); //normalize_image(weights[i]); } return weights; }
void rescale_weights(convolutional_layer l, float scale, float trans) { int i; for(i = 0; i < l.n; ++i){ image im = get_convolutional_weight(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_weights(convolutional_layer l) { image *weights = calloc(l.n, sizeof(image)); int i; for(i = 0; i < l.n; ++i){ weights[i] = copy_image(get_convolutional_weight(l, i)); normalize_image(weights[i]); /* char buff[256]; sprintf(buff, "filter%d", i); save_image(weights[i], buff); */ } //error("hey"); return weights; }