-
Notifications
You must be signed in to change notification settings - Fork 57
Add optional custom log_rewards to all GFlowNet losses #503
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c5b064a
Add optional custom log_rewards to all GFlowNet losses
josephdviviano 9630594
Add end-to-end tests for custom log_rewards parameter
josephdviviano 2308c24
Initial plan
Copilot 485dab7
fix: accept log_rewards kwarg in TBGAFN.get_scores with default None
Copilot 429e790
Merge pull request #504 from GFNOrg/copilot/fix-ci-failure-log-rewards
josephdviviano ee6f787
Update src/gfn/gflownet/sub_trajectory_balance.py
josephdviviano 11caee9
fix: make log_rewards keyword-only in all loss() and get_scores() met…
Copilot f7f0d40
Update testing/test_custom_log_rewards.py
josephdviviano 001ecd3
feat: raise ValueError when forward_looking=True with custom log_rewa…
Copilot 380f59b
Fix black formatting for CI (unstable string concatenation rules)
josephdviviano 5aaef2e
black
josephdviviano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
forward_looking=True,get_scores()still callsenv.log_reward(...)for the forward-looking reward adjustments, even if a customlog_rewardstensor is provided. This means custom rewards do not fully replace environment rewards in forward-looking mode (only the terminating boundary condition useslog_rewards). Either document this limitation explicitly or extend the API (e.g., accept separate forward-looking rewards / raise when both are used).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback
for now - raise when both are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit
001ecd3.DBGFlowNet.get_scores()now raisesValueErrorimmediately when bothforward_looking=Trueand a customlog_rewardstensor are provided. The docstring was also updated to document this restriction. A new testtest_forward_looking_raises_with_custom_log_rewardscovers this behavior.