| | |
| | | l.weights = calloc(outputs*inputs, sizeof(float)); |
| | | l.biases = calloc(outputs, sizeof(float)); |
| | | |
| | | l.forward = forward_connected_layer; |
| | | l.backward = backward_connected_layer; |
| | | l.update = update_connected_layer; |
| | | |
| | | //float scale = 1./sqrt(inputs); |
| | | float scale = sqrt(2./inputs); |
| | | for(i = 0; i < outputs*inputs; ++i){ |
| | |
| | | } |
| | | |
| | | #ifdef GPU |
| | | l.forward_gpu = forward_connected_layer_gpu; |
| | | l.backward_gpu = backward_connected_layer_gpu; |
| | | l.update_gpu = update_connected_layer_gpu; |
| | | |
| | | l.weights_gpu = cuda_make_array(l.weights, outputs*inputs); |
| | | l.biases_gpu = cuda_make_array(l.biases, outputs); |
| | | |
| | |
| | | if(l.batch_normalize){ |
| | | printf("Scales "); |
| | | print_statistics(l.scales, l.outputs); |
| | | /* |
| | | printf("Rolling Mean "); |
| | | print_statistics(l.rolling_mean, l.outputs); |
| | | printf("Rolling Variance "); |
| | | print_statistics(l.rolling_variance, l.outputs); |
| | | */ |
| | | } |
| | | printf("Biases "); |
| | | print_statistics(l.biases, l.outputs); |