pyepo.metric.regret

True regret loss

Module Contents

Functions

regret(predmodel, optmodel, dataloader)

A function to evaluate model performance with normalized true regret

calRegret(optmodel, pred_cost, true_cost, true_obj)

A function to calculate normalized true regret for a batch

pyepo.metric.regret.regret(predmodel, optmodel, dataloader)

A function to evaluate model performance with normalized true regret

Parameters:
  • predmodel (nn) – a regression neural network for cost prediction

  • optmodel (optModel) – an PyEPO optimization model

  • dataloader (DataLoader) – Torch dataloader from optDataSet

Returns:

true regret loss

Return type:

float

pyepo.metric.regret.calRegret(optmodel, pred_cost, true_cost, true_obj)

A function to calculate normalized true regret for a batch

Parameters:
  • optmodel (optModel) – optimization model

  • pred_cost (torch.tensor) – predicted costs

  • true_cost (torch.tensor) – true costs

  • true_obj (torch.tensor) – true optimal objective values

Returns:predmodel

float: true regret losses