mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
dropout probably ok
This commit is contained in:
parent
d7d7da2653
commit
cf0300ea55
2
Makefile
2
Makefile
@ -1,6 +1,6 @@
|
||||
GPU=1
|
||||
DEBUG=0
|
||||
ARCH= -arch=sm_50
|
||||
ARCH= -arch=sm_52
|
||||
|
||||
VPATH=./src/
|
||||
EXEC=darknet
|
||||
|
@ -7,6 +7,7 @@ int gpu_index = 0;
|
||||
#include "blas.h"
|
||||
#include "assert.h"
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
void check_error(cudaError_t status)
|
||||
@ -65,7 +66,7 @@ void cuda_random(float *x_gpu, int n)
|
||||
static int init = 0;
|
||||
if(!init){
|
||||
curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT);
|
||||
curandSetPseudoRandomGeneratorSeed(gen, 0ULL);
|
||||
curandSetPseudoRandomGeneratorSeed(gen, time(0));
|
||||
init = 1;
|
||||
}
|
||||
curandGenerateUniform(gen, x_gpu, n);
|
||||
|
@ -68,6 +68,7 @@ void partial(char *cfgfile, char *weightfile, char *outfile, int max)
|
||||
if(weightfile){
|
||||
load_weights_upto(&net, weightfile, max);
|
||||
}
|
||||
//net.seen = 0;
|
||||
save_weights(net, outfile);
|
||||
}
|
||||
|
||||
|
@ -16,11 +16,13 @@ void forward_dropout_layer_gpu(dropout_layer layer, network_state state)
|
||||
if (!state.train) return;
|
||||
int size = layer.inputs*layer.batch;
|
||||
cuda_random(layer.rand_gpu, size);
|
||||
/*
|
||||
int i;
|
||||
for(i = 0; i < size; ++i){
|
||||
layer.rand[i] = rand_uniform();
|
||||
}
|
||||
cuda_push_array(layer.rand_gpu, layer.rand, size);
|
||||
*/
|
||||
|
||||
yoloswag420blazeit360noscope<<<cuda_gridsize(size), BLOCK>>>(state.input, size, layer.rand_gpu, layer.probability, layer.scale);
|
||||
check_error(cudaPeekAtLastError());
|
||||
|
Loading…
Reference in New Issue
Block a user