pyepo.metric.unambregret ======================== .. py:module:: pyepo.metric.unambregret .. autoapi-nested-parse:: Unambiguous regret loss Functions --------- .. autoapisummary:: pyepo.metric.unambregret.unambRegret pyepo.metric.unambregret.calUnambRegret Module Contents --------------- .. py:function:: unambRegret(predmodel, optmodel, dataloader, tolerance=1e-05) A function to evaluate model performance with normalized unambiguous regret :param predmodel: a regression neural network for cost prediction :type predmodel: nn :param optmodel: an PyEPO optimization model :type optmodel: optModel :param dataloader: Torch dataloader from optDataSet :type dataloader: DataLoader :returns: unambiguous regret loss :rtype: float .. py:function:: calUnambRegret(optmodel, pred_cost, true_cost, true_obj, tolerance=1e-05) A function to calculate normalized unambiguous regret for a batch :param optmodel: optimization model :type optmodel: optModel :param pred_cost: predicted costs :type pred_cost: torch.tensor :param true_cost: true costs :type true_cost: torch.tensor :param true_obj: true optimal objective values :type true_obj: torch.tensor :returns: unambiguous regret losses :rtype: float