Machine learning systems typically assume that the distributions of training and test sets match closely. However, a critical requirement of such systems in the real world is their ability to generalize to unseen domains. Here, we propose an inter-domain gradient matching objective that targets domain generalization by maximizing the inner product between gradients from different domains. Since direct optimization of the gradient inner product can be computationally prohibitive -- requires computation of second-order derivatives -- we derive a simpler first-order algorithm named Fish that approximates its optimization. We demonstrate the efficacy of Fish on 6 datasets from the Wilds benchmark, which captures distribution shift across a diverse range of modalities. Our method produces competitive results on these datasets and surpasses all baselines on 4 of them. We perform experiments on both the Wilds benchmark, which captures distribution shift in the real world, as well as datasets in DomainBed benchmark that focuses more on synthetic-to-real transfer. Our method produces competitive results on both benchmarks, demonstrating its effectiveness across a wide range of domain generalization tasks.
翻译:机械学习系统通常假定培训和测试机组的分布很接近。然而,在现实世界中,这类系统的关键要求是能够向看不见的领域推广。在这里,我们提议了一个跨部梯度匹配目标,通过在不同领域梯度之间最大限度地增加内产物,将域内产品在不同的领域之间实现最大化。由于直接优化梯度内产物可成为无法计算的结果 -- -- 需要计算二阶衍生物 -- -- 我们得出一个更简单的一阶算法,名为鱼,接近其优化程度。我们展示了鱼类在野生物基准的6个数据集上的功效,该数据集捕捉了不同模式之间的分布转移。我们的方法在这些数据集上产生竞争结果,超过其中4个基准的所有基线。我们在野生物基准上进行实验,该基准捕捉到现实世界的分布变化,并在DomainBed基准中建立数据集,更侧重于合成到现实的转移。我们的方法在两个基准上都产生了竞争性的结果,显示了其在广泛领域一般化任务中的有效性。