清晰度感知最小化(SAM)和自适应清晰度感知最小化(ASAM)旨在改善模型的概括。在这个项目中,我们提出了三个实验,以从清晰度意识到的角度有效地概括它们。我们的实验表明,基于清晰度的优化技术可以帮助提供具有强大概括能力的模型。我们的实验还表明,ASAM可以改善对非归一化数据的概括性能,但是需要进一步的研究来确认这一点。
translated by 谷歌翻译
某些培训干预措施(例如提高学习率和应用批归归式化)的机制提高了深网的概括仍然是一个谜。先前的作品猜测,“扁平”解决方案比“更清晰”的解决方案更好地概括了看不见的数据,激发了几个指标来测量平坦度(尤其是损失Hessian最大的特征值);和算法,例如清晰度最小化(SAM)[1],它们直接优化了平坦度。其他作品质疑$ \ lambda_ {max} $与概括之间的链接。在本文中,我们提出了调用$ \ lambda_ {max} $对概括的影响的发现。我们表明:(1)虽然较大的学习率减少了所有批量尺寸的$ \ lambda_ {max} $,但概括益处有时会在较大的批量尺寸下消失; (2)通过同时缩放批量的大小和学习率,我们可以更改$ \ lambda_ {max} $,而不会影响概括; (3)虽然SAM生产较小的$ \ lambda_ {max} $,用于所有批次尺寸,概括益处(也)消失,较大的批量尺寸; (4)对于辍学,过高的辍学概率可能会降低概括,即使它们促进了较小的$ \ lambda_ {max} $; (5)虽然批处理范围并未始终产生较小的$ \ lambda_ {max} $,但它仍然赋予概括性优势。尽管我们的实验肯定了大型学习率和SAM对Minibatch SGD的概括优势,但GD-SGD差异证明了对$ \ lambda_ {Max} $解释神经网络中概括的能力的限制。
translated by 谷歌翻译
In today's heavily overparameterized models, the value of the training loss provides few guarantees on model generalization ability. Indeed, optimizing only the training loss value, as is commonly done, can easily lead to suboptimal model quality. Motivated by prior work connecting the geometry of the loss landscape and generalization, we introduce a novel, effective procedure for instead simultaneously minimizing loss value and loss sharpness. In particular, our procedure, Sharpness-Aware Minimization (SAM), seeks parameters that lie in neighborhoods having uniformly low loss; this formulation results in a minmax optimization problem on which gradient descent can be performed efficiently. We present empirical results showing that SAM improves model generalization across a variety of benchmark datasets (e.g., CIFAR-{10, 100}, Ima-geNet, finetuning tasks) and models, yielding novel state-of-the-art performance for several. Additionally, we find that SAM natively provides robustness to label noise on par with that provided by state-of-the-art procedures that specifically target learning with noisy labels. We open source our code at https: //github.com/google-research/sam. * Work done as part of the Google AI Residency program.
translated by 谷歌翻译
清晰度感知最小化(SAM)是一种最近的训练方法,它依赖于最严重的重量扰动,可显着改善各种环境中的概括。我们认为,基于pac-bayes概括结合的SAM成功的现有理由,而收敛到平面最小值的想法是不完整的。此外,没有解释说在SAM中使用$ m $ sharpness的成功,这对于概括而言至关重要。为了更好地理解SAM的这一方面,我们理论上分析了其对角线性网络的隐式偏差。我们证明,SAM总是选择一种比标准梯度下降更好的解决方案,用于某些类别的问题,并且通过使用$ m $ -sharpness可以放大这种效果。我们进一步研究了隐性偏见在非线性网络上的特性,在经验上,我们表明使用SAM进行微调的标准模型可以导致显着的概括改进。最后,当与随机梯度一起使用时,我们为非凸目标提供了SAM的收敛结果。我们从经验上说明了深层网络的这些结果,并讨论了它们与SAM的概括行为的关系。我们的实验代码可在https://github.com/tml-epfl/understanding-sam上获得。
translated by 谷歌翻译
经过深入的研究,最低限度的损失景观的局部形状,尤其是平坦度对于深层模型的概括起重要作用。我们开发了一种称为POF的培训算法:特征提取器的训练后培训,该培训更新了已经训练的深层模型的特征提取器部分,以搜索最小的最小值。特征是两倍:1)特征提取器在高层参数空间中的参数扰动下受到训练,基于表明使更高层参数空间变平的观测值,以及2)扰动范围以数据驱动的方式确定旨在减少由正损失曲率引起的一部分测试损失。我们提供了理论分析,该分析表明所提出的算法隐含地减少了目标Hessian组件以及损失。实验结果表明,POF仅针对CIFAR-10和CIFAR-100数据集的基线方法提高了模型性能,仅用于10个上学后培训,以及用于50个上学后培训的SVHN数据集。源代码可用:\ url {https://github.com/densoitlab/pof-v1
translated by 谷歌翻译
网络量化是一种有效的压缩方法,以降低模型大小和计算成本。尽管压缩比高,但训练低精度模型由于量化的离散和不可分散的性质,难以实现相当大的性能下降。最近,提出了清晰度感知最小化(SAM),以通过同时最小化损耗值和损耗曲率来改善模型的泛化性能。在本文中,我们设计了锐度感知量化(SAQ)方法来培训量化模型,从而导致更好的泛化性能。此外,由于每个层与网络的损耗和损耗锐度有不同的贡献,我们进一步设计了一种有效的方法,该方法学习配置生成器以自动确定每层的位宽度配置,鼓励平面区域的较低位,反之亦然尖锐的景观,同时促进最小值的平整度,以实现更积极的量化。对CiFar-100和Imagenet的广泛实验显示了所提出的方法的优越性。例如,我们的量化Reset-18具有55.1X比特操作(BOP)减少甚至在前1个精度方面均匀地优于0.7%。代码可在https://github.com/zhuang-group/saq获得。
translated by 谷歌翻译
已知最近的清晰度感知最小化(SAM)可以找到平坦的最小值,这有助于改善稳健性。 Sam通过报告当前迭代周围的小社区内的最大损失值来修改损失函数。但是,它使用欧几里得球来定义邻域,这可能是不准确的,因为神经网络的损失函数通常是根据概率分布(例如类预测概率)定义的,从而使参数空间空间非欧几里得。在本文中,我们在定义邻里时考虑了模型参数空间的信息几何形状,即用Fisher信息引起的椭圆形取代Sam的欧几里得球。我们称为Fisher Sam的方法定义了符合基础统计歧管的内在度量的更准确的邻域结构。例如,由于我们的Fisher Sam避免了参数空间几何形状,因此SAM可能会在附近或不当远处探测最坏情况下的损失值。最近,另一种自适应SAM方法会根据参数幅度的规模拉伸/收缩欧几里得球。这可能是危险的,有可能破坏邻里结构。我们证明了在几个基准数据集/任务上提出的Fisher SAM的性能提高。
translated by 谷歌翻译
如何训练深度神经网络(DNNS)很好地概括了深度学习的核心问题,尤其是对于当今严重的过度参数化网络。在本文中,我们提出了一种有效的方法来通过对优化过程中损失函数的梯度规范进行惩罚来改善模型的概括。我们证明,限制损失功能的梯度规范可以帮助引导优化者找到平坦的最小值。我们利用一阶近似来有效地实现相应的梯度,以适应梯度下降框架。在我们的实验中,我们确认使用我们的方法时,可以在不同的数据集中改善各种模型的概括性能。另外,我们表明,最近的清晰度最小化方法(Foret等,2021)是我们方法的特殊情况,但不是最好的情况,我们方法的最佳情况可以给出新的最先进的性能在这些任务上。代码可从{https://github.com/zhaoyang-0204/gnp}获得。
translated by 谷歌翻译
Real-world datasets exhibit imbalances of varying types and degrees. Several techniques based on re-weighting and margin adjustment of loss are often used to enhance the performance of neural networks, particularly on minority classes. In this work, we analyze the class-imbalanced learning problem by examining the loss landscape of neural networks trained with re-weighting and margin-based techniques. Specifically, we examine the spectral density of Hessian of class-wise loss, through which we observe that the network weights converge to a saddle point in the loss landscapes of minority classes. Following this observation, we also find that optimization methods designed to escape from saddle points can be effectively used to improve generalization on minority classes. We further theoretically and empirically demonstrate that Sharpness-Aware Minimization (SAM), a recent technique that encourages convergence to a flat minima, can be effectively used to escape saddle points for minority classes. Using SAM results in a 6.2\% increase in accuracy on the minority classes over the state-of-the-art Vector Scaling Loss, leading to an overall average increase of 4\% across imbalanced datasets. The code is available at: https://github.com/val-iisc/Saddle-LongTail.
translated by 谷歌翻译
彩票票证假设(LTH)引起了人们的关注,因为它可以解释为什么过度参数化模型通常显示出很高的概括能力。众所周知,当我们使用迭代幅度修剪(IMP)时,这是一种算法,可以找到具有高概括能力的稀疏网络,可以独立从初始权重训练,称为获胜票,最初的大型学习率在深层神经网络,例如重新连接。但是,由于最初的较大学习率通常有助于优化器收敛到平坦的最小值,因此我们假设获胜票的最小值相对较高,这在概括能力方面被认为是不利的。在本文中,我们证实了这一假设,并表明Pac-Bayesian理论可以对LTH与概括行为之间的关系有明确的理解。根据我们的实验发现,平坦度可用于提高标签噪声的准确性和稳健性,并且与初始权重的距离深深涉及获胜的门票,我们提供了使用尖峰和slab分布的PAC-Bayes绑定到的pac-bayes分析获胜门票。最后,我们重新审视了现有的算法,以从Pac-Bayesian的角度查找获奖门票,并对这些方法提供新的见解。
translated by 谷歌翻译
模型不合时宜的元学习(MAML)目前是少量元学习的主要方法之一。尽管它具有有效性,但由于先天的二聚体问题结构,MAML的优化可能具有挑战性。具体而言,MAML的损失格局比其经验风险最小化的对应物更为复杂,可能的鞍点和局部最小化可能更复杂。为了应对这一挑战,我们利用了最近发明的清晰度最小化的最小化,并开发出一种清晰感的MAML方法,我们称其为Sharp MAML。我们从经验上证明,Sharp-MAML及其计算有效的变体可以胜过流行的现有MAML基准(例如,Mini-Imagenet上的$+12 \%$ $精度)。我们通过收敛速率分析和尖锐MAML的概括结合进行了经验研究。据我们所知,这是在双层学习背景下对清晰度感知最小化的第一个经验和理论研究。该代码可在https://github.com/mominabbass/sharp-maml上找到。
translated by 谷歌翻译
在联邦设置中接受培训的模型通常会遭受降解的表演,并且在概括方面失败,尤其是在面对异质场景时。在这项工作中,我们通过损失和黑森特征光谱的几何形状的镜头来研究这种行为,将模型缺乏概括能力与溶液的清晰度联系起来。通过先前的研究将损失表面和概括差距连接起来的动机,我们表明i)在本地培训客户,以清晰感最小化(SAM)或其自适应版本(ASAM)和II)平均随机重量(SWA)服务器端可以基本上改善联合学习的概括,并帮助弥合差距,以中央集权模型。通过在具有均匀损失均匀损失的社区中寻求参数,该模型会收敛于平坦的最小值及其泛化,从而在均质和异质情况下都显着改善。经验结果证明了这些优化器在各种基准视觉数据集(例如CIFAR10/100,Landmarks-User-160K,IDDA)和任务(大规模分类,语义分割,域概括)中的有效性。
translated by 谷歌翻译
深度神经网络通常过度分辨,并且可能不容易实现模型泛化。对抗性训练通过规则地改变普遍选择的扰动之外的损失变化来提高普遍性的效果。最近提出的清晰度感知最小化(SAM)算法采用对抗性重量扰动,鼓励模型收敛于扁平最小值。遗憾的是,由于计算成本增加,对抗性重量扰动只能有效地近似于每批次而不是每个实例,导致性能下降。在本文中,我们提出了在每个批处理中动态重新缓解的扰动,其中揭开的实例被加权,可以用作每个实例扰动的更好近似。我们提出了充满活力的重新重量({\ Delta} -Sam)的清晰度感知最小化,这实现了高效的防护估计的想法。胶水基准测试的实验证明了{\ delta} -sam的有效性。
translated by 谷歌翻译
The vast majority of successful deep neural networks are trained using variants of stochastic gradient descent (SGD) algorithms. Recent attempts to improve SGD can be broadly categorized into two approaches: (1) adaptive learning rate schemes, such as AdaGrad and Adam, and (2) accelerated schemes, such as heavy-ball and Nesterov momentum. In this paper, we propose a new optimization algorithm, Lookahead, that is orthogonal to these previous approaches and iteratively updates two sets of weights. Intuitively, the algorithm chooses a search direction by looking ahead at the sequence of "fast weights" generated by another optimizer. We show that Lookahead improves the learning stability and lowers the variance of its inner optimizer with negligible computation and memory cost. We empirically demonstrate Lookahead can significantly improve the performance of SGD and Adam, even with their default hyperparameter settings on ImageNet, CIFAR-10/100, neural machine translation, and Penn Treebank.
translated by 谷歌翻译
Modern deep learning models are over-parameterized, where the optimization setup strongly affects the generalization performance. A key element of reliable optimization for these systems is the modification of the loss function. Sharpness-Aware Minimization (SAM) modifies the underlying loss function to guide descent methods towards flatter minima, which arguably have better generalization abilities. In this paper, we focus on a variant of SAM known as mSAM, which, during training, averages the updates generated by adversarial perturbations across several disjoint shards of a mini-batch. Recent work suggests that mSAM can outperform SAM in terms of test accuracy. However, a comprehensive empirical study of mSAM is missing from the literature -- previous results have mostly been limited to specific architectures and datasets. To that end, this paper presents a thorough empirical evaluation of mSAM on various tasks and datasets. We provide a flexible implementation of mSAM and compare the generalization performance of mSAM to the performance of SAM and vanilla training on different image classification and natural language processing tasks. We also conduct careful experiments to understand the computational cost of training with mSAM, its sensitivity to hyperparameters and its correlation with the flatness of the loss landscape. Our analysis reveals that mSAM yields superior generalization performance and flatter minima, compared to SAM, across a wide range of tasks without significantly increasing computational costs.
translated by 谷歌翻译
Quantization has become a predominant approach for model compression, enabling deployment of large models trained on GPUs onto smaller form-factor devices for inference. Quantization-aware training (QAT) optimizes model parameters with respect to the end task while simulating quantization error, leading to better performance than post-training quantization. Approximation of gradients through the non-differentiable quantization operator is typically achieved using the straight-through estimator (STE) or additive noise. However, STE-based methods suffer from instability due to biased gradients, whereas existing noise-based methods cannot reduce the resulting variance. In this work, we incorporate exponentially decaying quantization-error-aware noise together with a learnable scale of task loss gradient to approximate the effect of a quantization operator. We show this method combines gradient scale and quantization noise in a better optimized way, providing finer-grained estimation of gradients at each weight and activation layer's quantizer bin size. Our controlled noise also contains an implicit curvature term that could encourage flatter minima, which we show is indeed the case in our experiments. Experiments training ResNet architectures on the CIFAR-10, CIFAR-100 and ImageNet benchmarks show that our method obtains state-of-the-art top-1 classification accuracy for uniform (non mixed-precision) quantization, out-performing previous methods by 0.5-1.2% absolute.
translated by 谷歌翻译
随着最近在移动和边缘设备上部署神经网络模型的需求,希望提高模型对看不见的测试数据的普遍性,以及提高模型在固定点量化下的稳健性,以实现有效部署。然而,最大限度地减少培训损失在泛化和量化性能上提供了一些保证。在这项工作中,我们通过在改善模型对界限重量扰动的框架下理论上统一它们的理论上统一并最小化模型权重的稳健性并最小化了模型权重的框架的框架,同时履行泛化和量化性能。因此,我们提出了HESSIAN增强的鲁棒优化方法,以通过基于梯度的训练过程最小化Hessian特征值,同时提高泛化和量化性能。 HERO在测试准确性上高达3.8%,高度高达30%,在80%的培训标签扰动下的准确性高达30%,以及各种精度范围内的最佳训练后量化精度,包括在SGD上的高精度改善> 10%在各种数据集上的共同模型架构培训模型。
translated by 谷歌翻译
在神经网络的经验风险景观中扁平最小值的性质已经讨论了一段时间。越来越多的证据表明他们对尖锐物质具有更好的泛化能力。首先,我们讨论高斯混合分类模型,并分析显示存在贝叶斯最佳点估算器,其对应于属于宽平区域的最小值。可以通过直接在分类器(通常是独立的)或学习中使用的可分解损耗函数上应用最大平坦度算法来找到这些估计器。接下来,我们通过广泛的数值验证将分析扩展到深度学习场景。使用两种算法,熵-SGD和复制-SGD,明确地包括在优化目标中,所谓的非局部平整度措施称为本地熵,我们一直提高常见架构的泛化误差(例如Resnet,CeffectnNet)。易于计算的平坦度测量显示与测试精度明确的相关性。
translated by 谷歌翻译
Power等人报道的\ emph {grokking现象} {power2021grokking}是指一个长期过度拟合之后,似乎突然过渡到完美的概括。在本文中,我们试图通过一系列经验研究来揭示Grokking的基础。具体而言,我们在极端的训练阶段(称为\ emph {slingshot机构)发现了一个优化的异常缺陷自适应优化器。可以通过稳定和不稳定的训练方案之间的循环过渡来测量弹弓机制的突出伪像,并且可以通过最后一层重量的规范的循环行为轻松监测。我们从经验上观察到,在\ cite {power2021grokking}中报道的无明确正规化,几乎完全发生在\ emph {slingshots}的开始时,并且没有它。虽然在更一般的环境中常见且容易复制,但弹弓机制并不遵循我们所知道的任何已知优化理论,并且可以轻松地忽略而无需深入研究。我们的工作表明,在培训的后期阶段,适应性梯度优化器的令人惊讶且有用的归纳偏见,要求对其起源进行修订。
translated by 谷歌翻译
Neural network training relies on our ability to find "good" minimizers of highly non-convex loss functions. It is well-known that certain network architecture designs (e.g., skip connections) produce loss functions that train easier, and wellchosen training parameters (batch size, learning rate, optimizer) produce minimizers that generalize better. However, the reasons for these differences, and their effects on the underlying loss landscape, are not well understood. In this paper, we explore the structure of neural loss functions, and the effect of loss landscapes on generalization, using a range of visualization methods. First, we introduce a simple "filter normalization" method that helps us visualize loss function curvature and make meaningful side-by-side comparisons between loss functions. Then, using a variety of visualizations, we explore how network architecture affects the loss landscape, and how training parameters affect the shape of minimizers.
translated by 谷歌翻译