Personalization¶
1. Linear DRO Methods¶
2. NN-Based DRO Methods¶
2.1 Personalized Loss¶
For f-DRO
and WDRO
methods, our package supports personalized loss functions.
\(f\)-DRO¶
If the user would like to integrate his/her own loss functions, please
Create a new
RobustLoss
instance (fromfdro.utils.py
), and re-write theself._compute_individual_loss()
function to user-specified forms.Create a new
Chi2NNDRO
orCVaRNNDRO
instance (fromfdro_nn.py
), and re-write theself._criterion()
function with the newly-modifiedRobustLoss
instance above.
WDRO¶
When personalizing the loss function for WDRO, please:
Create a new
WNNDRO
instance (fromwdro_nn.py
).Re-write the
self._loss()
function.
2.2 Personalized Model Architecture¶
Users could pass their own model via self.update()
function. Note that the personalized model must be written via PyTorch
and is a sub-class of torch.nn.Module
.
3. Tree-Based DRO Methods¶
For tree-based DRO methods, users could simply rewrite the self.loss()
function