基于pytorch的adabound优化算法。
adabound的Python项目详细描述
adabound
一个优化器,训练速度和亚当一样快,也和SGD一样好,用于开发最先进的 关于cv、nlp等领域中各种瞳孔任务的深度学习模型。
基于Luo等人(2019年)。
Adaptive Gradient Methods with Dynamic Bound of Learning Rate。
在proc中。2019年ICLR
快速链接
安装
Adabound需要Python3.6.0或更高版本。 我们目前提供Pythorch版本和TensorFlow的Adabound即将推出。
通过PIP安装
安装adabound的首选方法是使用虚拟环境通过pip
。
只需运行
pip install adabound
在您的python环境中,您已经准备好了!
使用源代码
由于adabound是一个只有100多行的python类,另一种方法是直接下载 adabound.py并将其复制到项目中。
用法
您可以像其他pytorch优化器一样使用adabound。
optimizer=adabound.AdaBound(model.parameters(),lr=1e-3,final_lr=0.1)
如文中所述,adabound是一个优化器,其行为与adam在
训练,最后逐渐转变为新兵。
参数final_lr
表示adabound将以这种学习速率转换为sgd。
在一般情况下,默认的最终学习率0.1
可以达到相对良好和稳定的效果
未显示数据的结果。
它对超参数不是很敏感。
详见论文附录G。
尽管它具有健壮的性能,我们仍然必须声明,没有银弹。 这并不意味着一旦使用adabound,就可以自由地调整超参数。 模型的性能取决于很多因素,包括任务、模型结构, 数据的分发等。 您仍然需要根据您的具体情况决定要使用哪些超参数, 但你可能会比以前少用很多时间!
演示
感谢github团队和jupyter团队的出色工作,jupyter笔记本(.ipynb
)
文件可以直接在github上呈现。
我们提供了一些笔记本(如this one),以便更好地
形象化。
我们希望通过这些例子来说明adabound的健壮性能。
有关演示的完整列表,请参阅this page。
引用
如果你在研究中使用adabound,请引用Adaptive Gradient Methods with Dynamic Bound of Learning Rate。
@inproceedings{Luo2019AdaBound, author = {Luo, Liangchen and Xiong, Yuanhao and Liu, Yan and Sun, Xu}, title = {Adaptive Gradient Methods with Dynamic Bound of Learning Rate}, booktitle = {Proceedings of the 7th International Conference on Learning Representations}, month = {May}, year = {2019}, address = {New Orleans, Louisiana} }