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

Merged
merged 8 commits into from
Feb 6, 2025
Merged

Add Graph class #403

merged 8 commits into from
Feb 6, 2025

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
@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
@FilippoOlivo FilippoOlivo force-pushed the 0.2 branch 2 times, most recently from 17962fd to 89685a5 Compare February 3, 2025 14:51
@dario-coscia
Copy link
Collaborator

@FilippoOlivo @gc031298 This refactoring looks very nice!

@FilippoOlivo FilippoOlivo force-pushed the 0.2 branch 2 times, most recently from 67d39b0 to d1058e9 Compare February 4, 2025 10:50
@FilippoOlivo FilippoOlivo marked this pull request as ready for review February 5, 2025 10:16
@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 Feb 5, 2025
pina/data/dataset.py Show resolved Hide resolved
pina/graph.py Show resolved Hide resolved
pina/graph.py Show resolved Hide resolved
pina/graph.py Outdated
x, pos, edge_index = self._check_input_consistency(x, pos, edge_index)
print(len(pos))
if edge_index is None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

i don't know if this is nice to be kept here.. why radius and not knn? Do we really need a temporal graph? One could do a normal RadiusGraph and then add time as additional parameter

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok. As for now I remove TemporalGraph

pina/model/__init__.py Outdated Show resolved Hide resolved
internal_func=internal_func,
external_func=external_func)
self.n_layers = n_layers
self.forward = self.forward_shared
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like a lot this forward separation, is there a way to combine the two?

Copy link
Member Author

Choose a reason for hiding this comment

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

In order to have an efficient way to store parameters (avoid to use torch.nn.ModuleList with the same model repeated n_layer times), another possible solution is using an if in the forward. Otherwise I can define another 2 classes: one for the shared_weights and one for the non shared_weights. Let me know what how to proceed

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can keep it like this for the moment, maybe two classes is the best but for a single model I would not care a lot

pina/model/layers/__init__.py Outdated Show resolved Hide resolved
@dario-coscia
Copy link
Collaborator

@FilippoOlivo @gc031298 overall very nice, this looks a very nice integration in PINA! Just minor changes, I think we will be able to merge it soon :))

@ndem0 ndem0 merged commit 27d7398 into mathLab:0.2 Feb 6, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-to-review Label for PR that are ready to been reviewed v0.2 implementation in v0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Graph class implementation
4 participants