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

The questions in data_source.py #142

Open
SeonghwanSeo opened this issue Nov 11, 2024 · 1 comment
Open

The questions in data_source.py #142

SeonghwanSeo opened this issue Nov 11, 2024 · 1 comment

Comments

@SeonghwanSeo
Copy link

Hello,

Thanks for your great work!

I work on the gflownet-based project, and I wonder the role of following code block:
https://github.com/recursionpharma/gflownet/blob/trunk/src/gflownet/data/data_source.py [Line 254-256]

# Override the is_valid key in case the task made some objs invalid
for i in valid_idcs:
    trajs[i]["is_valid"] = True

Can I know why this code block does not mask the invalid objectives' trajectories as follows?

# Override the is_valid key in case the task made some objs invalid
for i, traj in enumerate(trajs):
    if i not in valid_idcs:
        traj["is_valid"] = False

Best regards,
Seonghwan Seo

@bengioe
Copy link
Collaborator

bengioe commented Nov 16, 2024

Hi Seonghwan, I think you may be right, the True should be a False and be iterating over invalid idcs 🤔
Basically there are two sources of invalidity, the sampling method (e.g. an illegal action is taken) and the task itself. In practice, we've mostly managed to create action masks so that this doesn't happen, and the tasks we use typically don't decide that objects are invalid, so this issue may have gone unnoticed!

I don't have time to test & fix this now so leaving this open. If you have the time, a PR is welcome!

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

No branches or pull requests

2 participants