| | |
| | | if(l.type == CONVOLUTIONAL){ |
| | | int num = l.n*l.c*l.size*l.size; |
| | | axpy_cpu(l.n, 1, l.biases, 1, out.biases, 1); |
| | | axpy_cpu(num, 1, l.filters, 1, out.filters, 1); |
| | | axpy_cpu(num, 1, l.weights, 1, out.weights, 1); |
| | | } |
| | | if(l.type == CONNECTED){ |
| | | axpy_cpu(l.outputs, 1, l.biases, 1, out.biases, 1); |
| | |
| | | if(l.type == CONVOLUTIONAL){ |
| | | int num = l.n*l.c*l.size*l.size; |
| | | scal_cpu(l.n, 1./n, l.biases, 1); |
| | | scal_cpu(num, 1./n, l.filters, 1); |
| | | scal_cpu(num, 1./n, l.weights, 1); |
| | | } |
| | | if(l.type == CONNECTED){ |
| | | scal_cpu(l.outputs, 1./n, l.biases, 1); |
| | |
| | | for(i = 0; i < net.n; ++i){ |
| | | layer l = net.layers[i]; |
| | | if(l.type == CONVOLUTIONAL){ |
| | | rescale_filters(l, 2, -.5); |
| | | rescale_weights(l, 2, -.5); |
| | | break; |
| | | } |
| | | } |
| | |
| | | for(i = 0; i < net.n; ++i){ |
| | | layer l = net.layers[i]; |
| | | if(l.type == CONVOLUTIONAL){ |
| | | rgbgr_filters(l); |
| | | rgbgr_weights(l); |
| | | break; |
| | | } |
| | | } |
| | |
| | | gpu_index = -1; |
| | | #else |
| | | if(gpu_index >= 0){ |
| | | cudaError_t status = cudaSetDevice(gpu_index); |
| | | check_error(status); |
| | | cuda_set_device(gpu_index); |
| | | } |
| | | #endif |
| | | |