# train for the 1000 labels of ImageNet |
Affine(nout=1000, init=Gaussian(scale=0.01), |
bias=Constant(-7), activation=Softmax()) |
Affine(nout=4096, init=Gaussian(scale=0.005), |
bias=Constant(.1), activation=Rectlin()), |
Dropout(keep=0.5), |
# train for the 21 labels of PascalVOC |
Affine(nout=21, init=Gaussian(scale=0.01), |
bias=Constant(0), activation=Softmax()) |
if hyper_params.use_pre_trained_weights: |
# This will typically train in 5-10 epochs. Use a small learning rate |
# and quickly reduce every few epochs. |
s = 1e-4 |
hyper_params.learning_rate_scale = s |
hyper_params.learning_rate_sched = Schedule(step_config=[15, 20], |
change=[0.5*s, 0.1*s]) |
hyper_params.momentum = 0.9 |
else: |
# need to actively manage the learning rate if the |
# model is not pre-trained |
s = 1e-2 |
hyper_params.learning_rate_scale = 1e-2 |
hyper_params.learning_rate_sched = Schedule( |
step_config=[8, 14, 18, 20], |
change=[0.5*s, 0.1*s, 0.05*s, 0.01*s]) |
hyper_params.momentum = 0.1 |
opt = GradientDescentMomentum(hyper_params.learning_rate_scale, |
hyper_params.momentum, wdecay=0.0005, |
schedule=hyper_params.learning_rate_sched) |
size = (np.amin(shape)-1) / scale |
num_samples = np.ceil( (shape-1) / size) |
exp = self.be.power(y, self.exponent) |
self.scores_batch[:] = self.be.add(exp, self.scores_batch) |
类别 | 飞机 | 自行车 | 鸟类 | 船 | 瓶子 | 公共汽车 | 汽车 | 猫 | 椅子 | 牛 |
AP | 81.17 | 79.32 | 81.21 | 74.84 | 52.89 | 74.57 | 87.72 | 78.54 | 63.00 | 69.57 |
类别 | 餐桌 | 狗 | 马 | 摩托车 | 人类 | 植物 | 羊 | 沙发 | 火车 | 电视 |
AP | 58.28 | 74.06 | 77.38 | 79.91 | 90.69 | 69.05 | 78.02 | 59.55 | 81.32 | 82.26 |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |