Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFY loss implimentation #46

Closed
biltang opened this issue Dec 12, 2024 · 1 comment
Closed

PFY loss implimentation #46

biltang opened this issue Dec 12, 2024 · 1 comment
Assignees
Labels
good first issue Good for newcomers

Comments

@biltang
Copy link

biltang commented Dec 12, 2024

I noticed the implemented perturbedFenchelYoung loss doesn't look the same as what is in the original paper and in the PyEPO paper. My guess is that from the perspective of tracking the directional improvement of the loss, the Fenchel Dual term is not strictly necessary, and that since we have a linear objective, the impact of the true cost is not needed either and we can just treat the loss as true_sol - expected_perturbed_solution. While this is not the precise definition of pFYL loss, it will show the same directional behavior (subject to some additive/multiplicative constants). Is this understanding correct? Thank you!

@LucasBoTang LucasBoTang self-assigned this Dec 13, 2024
@LucasBoTang LucasBoTang added the good first issue Good for newcomers label Dec 13, 2024
@LucasBoTang LucasBoTang pinned this issue Dec 13, 2024
@LucasBoTang
Copy link
Collaborator

Hi @biltang ,

Thank you for asking! This is an excellent question, and your understanding is absolutely correct.

In the perturbed method, the PFY loss is implicitly defined. While we can compute its gradients explicitly, the loss term itself involves the Fenchel Dual term, which cannot be directly calculated. This makes it hard to define the loss function explicitly. What's interesting here is that, even without an explicit loss function, we can still update the model effectively using the gradients.

In the current implementation, I chose to "represent" the loss as true_sol - expected_sol. While this isn't equivalent to the PFY loss as defined in theory, it does serve as a practical surrogate that reflects the quality of decisions to a certain extent.

Incidentally, I recently discussed with Professor Vishal Gupta, and their recent paper, "Decision-Focused Learning with Directional Gradients", explores an explicit PFY loss via "integrate back." I plan to support this feature in future updates to PyEPO.

This is a very insightful and important question. Thanks again for your thoughtful question!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants