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

Add local search sampler #208

Merged
merged 19 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix a minor error in the Trajectory.__repr__
hyeok9855 committed Nov 26, 2024
commit 8481673495314ffea4462822c80479abca134f43
4 changes: 2 additions & 2 deletions src/gfn/containers/trajectories.py
Original file line number Diff line number Diff line change
@@ -122,15 +122,15 @@ def __repr__(self) -> str:
for traj in states[:10]:
one_traj_repr = []
for step in traj:
one_traj_repr.append(str(step.numpy()))
one_traj_repr.append(str(step.cpu().numpy()))
if step.equal(self.env.s0 if self.is_backward else self.env.sf):
break
trajectories_representation += "-> ".join(one_traj_repr) + "\n"
return (
f"Trajectories(n_trajectories={self.n_trajectories}, max_length={self.max_length}, First 10 trajectories:"
+ f"states=\n{trajectories_representation}"
# + f"actions=\n{self.actions.tensor.squeeze().transpose(0, 1)[:10].numpy()}, "
+ f"when_is_done={self.when_is_done[:10].numpy()})"
+ f"when_is_done={self.when_is_done[:10].cpu().numpy()})"
)

@property