mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
fix #227 softmax parts of the code wasn't being run when GPU=1
This commit is contained in:
parent
62b781af4d
commit
4ce51a7e70
@ -156,7 +156,6 @@ void forward_region_layer(const layer l, network net)
|
|||||||
int i,j,b,t,n;
|
int i,j,b,t,n;
|
||||||
memcpy(l.output, net.input, l.outputs*l.batch*sizeof(float));
|
memcpy(l.output, net.input, l.outputs*l.batch*sizeof(float));
|
||||||
|
|
||||||
#ifndef GPU
|
|
||||||
for (b = 0; b < l.batch; ++b){
|
for (b = 0; b < l.batch; ++b){
|
||||||
for(n = 0; n < l.n; ++n){
|
for(n = 0; n < l.n; ++n){
|
||||||
int index = entry_index(l, b, n*l.w*l.h, 0);
|
int index = entry_index(l, b, n*l.w*l.h, 0);
|
||||||
@ -177,7 +176,6 @@ void forward_region_layer(const layer l, network net)
|
|||||||
int index = entry_index(l, 0, 0, l.coords + !l.background);
|
int index = entry_index(l, 0, 0, l.coords + !l.background);
|
||||||
softmax_cpu(net.input + index, l.classes + l.background, l.batch*l.n, l.inputs/l.n, l.w*l.h, 1, l.w*l.h, 1, l.output + index);
|
softmax_cpu(net.input + index, l.classes + l.background, l.batch*l.n, l.inputs/l.n, l.w*l.h, 1, l.w*l.h, 1, l.output + index);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
memset(l.delta, 0, l.outputs * l.batch * sizeof(float));
|
memset(l.delta, 0, l.outputs * l.batch * sizeof(float));
|
||||||
if(!net.train) return;
|
if(!net.train) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user