Domain generalization (DG) aims to create models that perform well on new, unseen domains by addressing distribution shifts.
Existing methods focusing on aligning domain-level gradients and Hessians for DG are computationally inefficient and lack clear underlying principles.
This paper introduces the theory of moment alignment for DG, which unifies Invariant Risk Minimization, gradient matching, and Hessian matching approaches.
The proposed Closed-Form Moment Alignment (CMA) algorithm aligns domain-level gradients and Hessians efficiently, demonstrating superior performance in experiments compared to existing algorithms.