Gradient Matching for Domain Generalization