Domain generalisation (DG) assumes a model is trained from multiple observed domains while it is expected to perform well on any unseen domains.
Here is a catastrophically simple implementation of DG.
The pseudo-code looks like,
Do it a few times:
Randomly split all observed domains into training domains and validation domains
Do it many times:
Get a mini-batch from aggregated training domains
Get a mini-batch from aggregated validation domains
Minimise the loss: loss_from_training_error + ||gradient_from_validation_error||_2^2