论文阅读:Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour

论文阅读:Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour

论文地址: https://arxiv.org/pdf/1706.02677

背景

1)larger networks and larger datasets need longer time for training;

解决方法:分布式同步SGD,将SGD minibatches分配给并行工作站。
(distributed synchronous SGD offers a potential solution to the problem by dividing SGD minibatches over a pool of parallel workers.)

2)large minibatches’s main issue is: optimization difficultly rather than poor generalization.

解决方法:Authors provide some strategies

use large minibatch in place of small minibatches while maintaining training and generalization accuracy.

但是,用large minibatch会使得optimization difficultly,针对这个问题,作者提出一些tips.

Large minibatch SGD

首先,回忆一下SGD的公式:

1)损失函数:
L ( w ) = 1 X ∑ x ∈ X l ( x , w ) L(w)=\frac{1}{X}\sum_{x \in X} l(x,w) L(w)=X1xXl(x,w)

X X X为全部的训练集, w w w为权值, l ( x , w ) l(x,w) l(x,w)为单个sample x x x的损失函数
2)权值更新:
w t + 1 = w t − η 1 n ∑ x ∈ B Δ l ( x , w t ) w_{ t+1 }=w_{ t } - \eta \frac{1}{n} \sum_{x \in B } \Delta l(x,w_{t}) wt+1=wtηn1xBΔl(x,wt)
B B B为minibatch sample, n n n ∣ B ∣ \left | B \right | B η \eta η为学习率, t t t为迭代index.

Large minibatch

Linear Scaling Ruler:在这里插入图片描述
Warmup在这里插入图片描述
BN在这里插入图片描述

Tips在这里插入图片描述在这里插入图片描述

在这里插入图片描述在这里插入图片描述

Communication

对于每一个参数的梯度,都是通过allreduce操作来进行汇聚的。在进行allreduce之前,每个GPU都会计算自己的梯度,在allreduce*之后,每个GPU得到梯度的和。

推荐参考:

https://www.zhihu.com/question/60874090
https://www.jianshu.com/p/738ff3628543

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值