| | |
| | | |
| | | l.biases = calloc(n, sizeof(float)); |
| | | l.bias_updates = calloc(n, sizeof(float)); |
| | | //float scale = 1./sqrt(size*size*c); |
| | | // float scale = 1./sqrt(size*size*c); |
| | | float scale = sqrt(2./(size*size*c)); |
| | | for(i = 0; i < c*n*size*size; ++i) l.filters[i] = 2*scale*rand_uniform() - scale; |
| | | for(i = 0; i < n; ++i){ |
| | |
| | | cuda_free(l->delta_gpu); |
| | | cuda_free(l->output_gpu); |
| | | |
| | | l->col_image_gpu = cuda_make_array(0, out_h*out_w*l->size*l->size*l->c); |
| | | l->delta_gpu = cuda_make_array(0, l->batch*out_h*out_w*l->n); |
| | | l->output_gpu = cuda_make_array(0, l->batch*out_h*out_w*l->n); |
| | | l->col_image_gpu = cuda_make_array(l->col_image, out_h*out_w*l->size*l->size*l->c); |
| | | l->delta_gpu = cuda_make_array(l->delta, l->batch*out_h*out_w*l->n); |
| | | l->output_gpu = cuda_make_array(l->output, l->batch*out_h*out_w*l->n); |
| | | #endif |
| | | } |
| | | |
| | |
| | | int i; |
| | | for(i = 0; i < l.n; ++i){ |
| | | filters[i] = copy_image(get_convolutional_filter(l, i)); |
| | | normalize_image(filters[i]); |
| | | //normalize_image(filters[i]); |
| | | } |
| | | return filters; |
| | | } |