From 01d27901cc2dec9042bc77db7a7b0b3b75448eef Mon Sep 17 00:00:00 2001 From: zhanghang1989 Date: Thu, 15 Sep 2016 18:10:51 -0400 Subject: [PATCH] fix bug for plain net --- .gitignore | 1 + init/res_cifar_init.m | 6 +++--- res_cifar.m | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8fce603..505b597 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ data/ +*.swp diff --git a/init/res_cifar_init.m b/init/res_cifar_init.m index d61a11b..6228c25 100644 --- a/init/res_cifar_init.m +++ b/init/res_cifar_init.m @@ -12,7 +12,7 @@ opts.networkType = 'resnet'; % 'plain' | 'resnet' -opts.reLUafterSum = false; +opts.reLUafterSum = true; opts.shortcutBN = false; opts = vl_argparse(opts, varargin); @@ -85,12 +85,12 @@ lName = sprintf('relu%d', info.lastIdx); end add_block_conv(net, sprintf('%d', info.lastIdx+1), lName, ... - [w w info.lastNumChannel ch], stride, bn, true); + [w w info.lastNumChannel ch], stride, opts); info.lastIdx = info.lastIdx + 1; info.lastNumChannel = ch; for i=2:2*n, add_block_conv(net, sprintf('%d', info.lastIdx+1), sprintf('relu%d', info.lastIdx), ... - [w w ch ch], 1, bn, true); + [w w ch ch], 1, opts); info.lastIdx = info.lastIdx + 1; end elseif strcmpi(netType, 'resnet'), diff --git a/res_cifar.m b/res_cifar.m index 4998285..6ceeec4 100644 --- a/res_cifar.m +++ b/res_cifar.m @@ -4,7 +4,7 @@ setup; opts.modelType = 'resnet' ; opts.preActivation = false; -opts.reLUafterSum = false; +opts.reLUafterSum = true; opts.shortcutBN = false; [opts, varargin] = vl_argparse(opts, varargin) ;