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

Backward trajectory time steps in intro_gfn_continuous_line.ipynb #182

Closed
tsa87 opened this issue Jul 24, 2024 · 3 comments
Closed

Backward trajectory time steps in intro_gfn_continuous_line.ipynb #182

tsa87 opened this issue Jul 24, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@tsa87
Copy link

tsa87 commented Jul 24, 2024

Thank you for this great library. In the tutorial notebook, for computing PB of trajectory, we only consider timestep range [trajectory_length, 2). Why do we stop at time step 2?

The code work and the performance seems to improve if we consider the timestep range [trajectory_length, 1). (Skipping modelling backward step of time 1 to time 0)

# Backward loop to compute logPB from existing trajectory under the backward policy.
for t in range(trajectory_length, 2, -1):
    policy_dist = get_policy_dist(backward_model, trajectory[:, t, :])
    action = trajectory[:, t, 0] - trajectory[:, t - 1, 0]
    logPB += policy_dist.log_prob(action)
@josephdviviano
Copy link
Collaborator

Thanks for raising this and sorry for the delay. I am looking into it now.

@josephdviviano josephdviviano self-assigned this Sep 20, 2024
@josephdviviano josephdviviano added the bug Something isn't working label Sep 20, 2024
@josephdviviano
Copy link
Collaborator

OK. thanks. You identified a strange holdover bug from a long time ago. I've updated both notebooks (other than the incomplete one) with the solutions from the gflownet workshop. I think they are both easier to read, and for sure bug free. Sorry for the delay getting back to you.

Addressed here: #187

@josephdviviano
Copy link
Collaborator

This is merged into main - please reopen if you continue to have issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants