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

Draft: Add Graphs as States for torchgfn #210

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

alip67
Copy link
Collaborator

@alip67 alip67 commented Nov 6, 2024

Description:
Unlike the current States object that necessitates appending dummy states to batch trajectories of varying lengths, our approach aims to support Trajectories through a nested Batch object representation. The Data class in Torch Geometric represents the graph structure, while the Batch class, which encapsulates batching of Data objects and their efficient indexing, represents the GraphStates object.

The current implementation of Trajectory supports the indexing dimensions: (Num time steps, Num trajectories, State Size). By using a nested Batch of Batch object to represent state Trajectories, the indexing would inherently take the form (Num trajectories, Num timesteps, State size). This approach requires implementing logic within _getitem_() and _setitem_() to internally.

To Do:
Compatibility check with Trajectories, Transition class

@alip67 alip67 marked this pull request as draft November 6, 2024 12:43
@alip67 alip67 marked this pull request as ready for review November 6, 2024 12:50
@alip67 alip67 marked this pull request as draft November 6, 2024 12:51
graphs: Batch = copy.deepcopy(states.data)
assert len(graphs) == len(actions)

for i, act in enumerate(actions.tensor):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self - we should evaluate if this can be vectorized.

graphs: Batch = copy.deepcopy(states.data)
assert len(graphs) == len(actions)

for i, act in enumerate(actions.tensor):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self - we should evaluate if this can be vectorized.

@saleml
Copy link
Collaborator

saleml commented Dec 6, 2024

Thank you @younik and @alip67 for this important PR. Is there a script we can play with to see the training of the environment you created?

@younik
Copy link
Collaborator

younik commented Dec 6, 2024

Thank you @younik and @alip67 for this important PR. Is there a script we can play with to see the training of the environment you created?

There are still some issues to fix that prevent it from running properly.
I am working to fix them and will post a sample code for using it

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

Successfully merging this pull request may close these issues.

4 participants