Skip to content

Commit

Permalink
Merging to f6d8617 of upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
prabindh committed Jun 16, 2018
1 parent 10a156f commit 01365fb
Show file tree
Hide file tree
Showing 23 changed files with 225 additions and 67 deletions.
3 changes: 0 additions & 3 deletions cfg/alexnet.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,3 @@ activation=linear
[softmax]
groups=1

[cost]
type=sse

3 changes: 0 additions & 3 deletions cfg/cifar.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,3 @@ activation=leaky

[softmax]
groups=1

[cost]

2 changes: 0 additions & 2 deletions cfg/cifar.test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,3 @@ activation=leaky
groups=1
temperature=3

[cost]

3 changes: 0 additions & 3 deletions cfg/darknet19.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,3 @@ activation=linear
[softmax]
groups=1

[cost]
type=sse

3 changes: 0 additions & 3 deletions cfg/darknet19_448.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,3 @@ activation=linear
[softmax]
groups=1

[cost]
type=sse

3 changes: 0 additions & 3 deletions cfg/densenet201.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,3 @@ activation=linear
[softmax]
groups=1

[cost]
type=sse

3 changes: 0 additions & 3 deletions cfg/extraction.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,3 @@ activation=leaky
[softmax]
groups=1

[cost]
type=sse

3 changes: 0 additions & 3 deletions cfg/extraction22k.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,3 @@ activation=leaky
[softmax]
groups=1

[cost]
type=sse

3 changes: 0 additions & 3 deletions cfg/go.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,3 @@ stride=1

[softmax]

[cost]
type=sse

2 changes: 0 additions & 2 deletions cfg/go.test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,4 @@ stride=1

[softmax]

[cost]
type=sse

2 changes: 0 additions & 2 deletions cfg/gru.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,4 @@ activation=linear

[softmax]

[cost]
type=sse

3 changes: 0 additions & 3 deletions cfg/resnet152.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,3 @@ activation=linear
[softmax]
groups=1

[cost]
type=sse

2 changes: 0 additions & 2 deletions cfg/resnet50.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,4 @@ activation=linear
[softmax]
groups=1

[cost]
type=sse

2 changes: 0 additions & 2 deletions cfg/rnn.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,4 @@ activation=leaky

[softmax]

[cost]
type=sse

2 changes: 0 additions & 2 deletions cfg/rnn.train.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,4 @@ activation=leaky

[softmax]

[cost]
type=sse

3 changes: 0 additions & 3 deletions cfg/strided.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,3 @@ activation=ramp

[softmax]

[cost]
type=sse

2 changes: 0 additions & 2 deletions cfg/tiny.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,4 @@ activation=linear
[softmax]
groups=1

[cost]
type=sse

2 changes: 0 additions & 2 deletions cfg/vgg-16.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,4 @@ activation=linear
[softmax]
groups=1

[cost]
type=sse

182 changes: 182 additions & 0 deletions cfg/yolov3-tiny.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
[net]
# Testing
batch=1
subdivisions=1
# Training
# batch=64
# subdivisions=2
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
burn_in=1000
max_batches = 500200
policy=steps
steps=400000,450000
scales=.1,.1

[convolutional]
batch_normalize=1
filters=16
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=1

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

###########

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear



[yolo]
mask = 3,4,5
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=80
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 8

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear

[yolo]
mask = 1,2,3
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=80
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
6 changes: 3 additions & 3 deletions cfg/yolov3.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 37
classes=80
num=9
jitter=.3
ignore_thresh = .5
ignore_thresh = .7
truth_thresh = 1
random=1

Expand Down Expand Up @@ -696,7 +696,7 @@ anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 37
classes=80
num=9
jitter=.3
ignore_thresh = .5
ignore_thresh = .7
truth_thresh = 1
random=1

Expand Down Expand Up @@ -783,7 +783,7 @@ anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 37
classes=80
num=9
jitter=.3
ignore_thresh = .5
ignore_thresh = .7
truth_thresh = 1
random=1

26 changes: 17 additions & 9 deletions src/convolutional_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ void forward_convolutional_layer_gpu(convolutional_layer l, network net)
float *a = l.weights_gpu + j*l.nweights/l.groups;
float *b = net.workspace;
float *c = l.output_gpu + (i*l.groups + j)*n*m;
float *im = net.input_gpu + (i*l.groups + j)*l.c/l.groups*l.h*l.w;

im2col_gpu(net.input_gpu + (i*l.groups + j)*l.c/l.groups*l.h*l.w,
l.c/l.groups, l.h, l.w, l.size, l.stride, l.pad, b);
if (l.size == 1){
b = im;
} else {
im2col_gpu(im, l.c/l.groups, l.h, l.w, l.size, l.stride, l.pad, b);
}
gemm_gpu(0,0,m,n,k,1,a,k,b,n,1,c,n);
}
}
Expand Down Expand Up @@ -234,22 +238,26 @@ void backward_convolutional_layer_gpu(convolutional_layer l, network net)
float *b = net.workspace;
float *c = l.weight_updates_gpu + j*l.nweights/l.groups;

float *im = net.input_gpu+(i*l.groups + j)*l.c/l.groups*l.h*l.w;
float *im = net.input_gpu+(i*l.groups + j)*l.c/l.groups*l.h*l.w;
float *imd = net.delta_gpu+(i*l.groups + j)*l.c/l.groups*l.h*l.w;

im2col_gpu(im, l.c/l.groups, l.h, l.w,
l.size, l.stride, l.pad, b);
im2col_gpu(im, l.c/l.groups, l.h, l.w, l.size, l.stride, l.pad, b);
gemm_gpu(0,1,m,n,k,1,a,k,b,k,1,c,n);

if(net.delta_gpu){
if(l.binary || l.xnor) swap_binary(&l);
if (net.delta_gpu) {
if (l.binary || l.xnor) swap_binary(&l);
a = l.weights_gpu + j*l.nweights/l.groups;
b = l.delta_gpu + (i*l.groups + j)*m*k;
c = net.workspace;
if (l.size == 1) {
c = imd;
}

gemm_gpu(1,0,n,k,m,1,a,n,b,k,0,c,k);

col2im_gpu(net.workspace, l.c/l.groups, l.h, l.w, l.size, l.stride,
l.pad, net.delta_gpu + (i*l.groups + j)*l.c/l.groups*l.h*l.w);
if (l.size != 1) {
col2im_gpu(net.workspace, l.c/l.groups, l.h, l.w, l.size, l.stride, l.pad, imd);
}
if(l.binary || l.xnor) {
swap_binary(&l);
}
Expand Down
Loading

0 comments on commit 01365fb

Please sign in to comment.