-
Notifications
You must be signed in to change notification settings - Fork 70
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
base: 0.2
Are you sure you want to change the base?
Add Graph class #403
Conversation
@FilippoOlivo I would avoid to write a graph solver, |
567f207
to
1867274
Compare
11a43ec
to
290641a
Compare
7ba1b32
to
238f665
Compare
I would say green light on my side! |
@FilippoOlivo there is still the
|
17962fd
to
89685a5
Compare
@FilippoOlivo @gc031298 This refactoring looks very nice! |
67d39b0
to
d1058e9
Compare
custom_build_edge_attr=None, | ||
additional_params=None | ||
): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a more rich doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and pushed. Let me know if now it is good enough
return 1 | ||
|
||
@staticmethod | ||
def _check_input_consistency(x, pos, edge_index=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a raise TypeError
if the conditions are not met (one for x
one for pos
and one for edge_index
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also in other function I would add as many raise as possible, while being precise on the error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add error handling in the function
pina/graph.py
Outdated
x, pos, edge_index = self._check_input_consistency(x, pos, edge_index) | ||
print(len(pos)) | ||
if edge_index is None: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
@@ -20,3 +21,4 @@ | |||
from .avno import AveragingNeuralOperator | |||
from .lno import LowRankNeuralOperator | |||
from .spline import Spline | |||
from .gno import GNO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GraphNeuralOperator
full name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
internal_func=internal_func, | ||
external_func=external_func) | ||
self.n_layers = n_layers | ||
self.forward = self.forward_shared |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
pina/model/layers/__init__.py
Outdated
@@ -15,6 +15,7 @@ | |||
"AVNOBlock", | |||
"LowRankBlock", | |||
"RBFBlock", | |||
"GraphIntegralLayer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GNOBlock
@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 :)) |
…ndling. Remove TemporalGraph class
This PR refers to the issue #400