mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
fixes
This commit is contained in:
parent
60e952ba69
commit
38802ef56a
@ -1,8 +1,8 @@
|
|||||||
[net]
|
[net]
|
||||||
batch=64
|
batch=64
|
||||||
subdivisions=8
|
subdivisions=8
|
||||||
height=608
|
height=416
|
||||||
width=608
|
width=416
|
||||||
channels=3
|
channels=3
|
||||||
momentum=0.9
|
momentum=0.9
|
||||||
decay=0.0005
|
decay=0.0005
|
||||||
|
@ -148,6 +148,14 @@ void forward_region_layer(const layer l, network_state state)
|
|||||||
memcpy(l.output, state.input, l.outputs*l.batch*sizeof(float));
|
memcpy(l.output, state.input, l.outputs*l.batch*sizeof(float));
|
||||||
|
|
||||||
#ifndef GPU
|
#ifndef GPU
|
||||||
|
for (b = 0; b < l.batch; ++b){
|
||||||
|
for(n = 0; n < l.n; ++n){
|
||||||
|
int index = entry_index(l, b, n*l.w*l.h, 0);
|
||||||
|
activate_array(l.output + index, 2*l.w*l.h, LOGISTIC);
|
||||||
|
index = entry_index(l, b, n*l.w*l.h, 4);
|
||||||
|
activate_array(l.output + index, l.w*l.h, LOGISTIC);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (l.softmax_tree){
|
if (l.softmax_tree){
|
||||||
int i;
|
int i;
|
||||||
int count = 5;
|
int count = 5;
|
||||||
@ -157,7 +165,8 @@ void forward_region_layer(const layer l, network_state state)
|
|||||||
count += group_size;
|
count += group_size;
|
||||||
}
|
}
|
||||||
} else if (l.softmax){
|
} else if (l.softmax){
|
||||||
softmax_cpu(state.input + 5, l.classes, l.batch, l.inputs, l.n*l.w*l.h, 1, l.n*l.w*l.h, l.temperature, l.output + 5);
|
int index = entry_index(l, 0, 0, 5);
|
||||||
|
softmax_cpu(state.input + index, l.classes, l.batch*l.n, l.inputs/l.n, l.w*l.h, 1, l.w*l.h, 1, l.output + index);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -429,7 +438,7 @@ void forward_region_layer_gpu(const layer l, network_state state)
|
|||||||
cpu_state.truth = truth_cpu;
|
cpu_state.truth = truth_cpu;
|
||||||
cpu_state.input = in_cpu;
|
cpu_state.input = in_cpu;
|
||||||
forward_region_layer(l, cpu_state);
|
forward_region_layer(l, cpu_state);
|
||||||
cuda_push_array(l.output_gpu, l.output, l.batch*l.outputs);
|
//cuda_push_array(l.output_gpu, l.output, l.batch*l.outputs);
|
||||||
free(cpu_state.input);
|
free(cpu_state.input);
|
||||||
if(!state.train) return;
|
if(!state.train) return;
|
||||||
cuda_push_array(l.delta_gpu, l.delta, l.batch*l.outputs);
|
cuda_push_array(l.delta_gpu, l.delta, l.batch*l.outputs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user