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 Graph class #403

Draft
wants to merge 1 commit into
base: 0.2
Choose a base branch
from
Draft

Add Graph class #403

wants to merge 1 commit into from

Conversation

FilippoOlivo
Copy link
Member

@FilippoOlivo FilippoOlivo commented Jan 16, 2025

This PR refers to the issue #400

@dario-coscia
Copy link
Collaborator

@FilippoOlivo I would avoid to write a graph solver, SupervisedSolver should be used

@FilippoOlivo FilippoOlivo force-pushed the 0.2 branch 10 times, most recently from 567f207 to 1867274 Compare January 24, 2025 09:16
@FilippoOlivo FilippoOlivo marked this pull request as ready for review January 24, 2025 12:41
@FilippoOlivo FilippoOlivo added the pr-to-fix Label for PR that needs modification label Jan 24, 2025
@FilippoOlivo FilippoOlivo self-assigned this Jan 24, 2025
@FilippoOlivo FilippoOlivo requested a review from gc031298 January 24, 2025 12:41
@dario-coscia dario-coscia changed the title Add Graph class and Supervised Graph solver Add Graph class Jan 24, 2025
@FilippoOlivo FilippoOlivo force-pushed the 0.2 branch 5 times, most recently from 11a43ec to 290641a Compare January 25, 2025 13:20
@FilippoOlivo FilippoOlivo marked this pull request as draft January 27, 2025 08:32
@FilippoOlivo FilippoOlivo force-pushed the 0.2 branch 3 times, most recently from 7ba1b32 to 238f665 Compare January 27, 2025 15:26
@FilippoOlivo FilippoOlivo marked this pull request as ready for review January 27, 2025 15:26
@FilippoOlivo FilippoOlivo added pr-to-review Label for PR that are ready to been reviewed and removed pr-to-fix Label for PR that needs modification labels Jan 27, 2025
@FilippoOlivo FilippoOlivo marked this pull request as draft January 27, 2025 16:47
@FilippoOlivo FilippoOlivo force-pushed the 0.2 branch 2 times, most recently from cf42cf4 to 6e13f96 Compare January 27, 2025 21:39
if isinstance(pos, torch.Tensor):
pos = [pos]
edge_index = [edge_index]
distance = [pos_[edge_index_[0]] - pos_[edge_index_[1]] ** 2 for
Copy link
Collaborator

Choose a reason for hiding this comment

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

edge_attr is computed as the square of the distance, instead of the standard distance. Is this the desired behavior?

raise ValueError("The method must be 'radius' or 'knn.")
if isinstance(pos, (torch.Tensor, LabelTensor)):
if isinstance(pos, LabelTensor):
pos = pos.tensor
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would keep pos as a LabelTensor to simplify managing coordinates in multidimensional problems. For example, in a 2-dimensional problem, how would you access the x or y coordinates individually? @dario-coscia, can you think of any scenario where accessing coordinates separately might be useful?

@FilippoOlivo FilippoOlivo linked an issue Jan 28, 2025 that may be closed by this pull request
@dario-coscia
Copy link
Collaborator

dario-coscia commented Jan 29, 2025

@FilippoOlivo please remove from commit a862dc8 to f0ddee6, they should pertain to a different PR #433 . Only graph updates should be here

@FilippoOlivo
Copy link
Member Author

@dario-coscia Done! Remove useless commits

@ndem0
Copy link
Member

ndem0 commented Jan 29, 2025

I would say green light on my side!

@dario-coscia
Copy link
Collaborator

@FilippoOlivo there is still the supervised.py file not tracked. Also I remember last time we discussed to divide the classes:

  • A base GraphInterface
  • RadiusGraph
  • KNNGraph
  • Graph
  • TemporalGraph
  • ....

@dario-coscia dario-coscia added pr-to-fix Label for PR that needs modification v0.2 implementation in v0.2 and removed pr-to-review Label for PR that are ready to been reviewed labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-to-fix Label for PR that needs modification v0.2 implementation in v0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Graph class implementation
4 participants