Custom loss function using nodes predicted output #383
Unanswered
RaphaelChristienECTL
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hello, to compute sparse pairwise differences between neighbours, you can do something similar to the EdgeConv layer. cheers |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everybody !
I am really happy with spektral, thanks for this !
I currently have a model predicting a sequence of real numbers (representing a trajectory, x1, y1, x2, y2 etc.)
for each graph node (a moving object).
These moving objects must not get too close from each other.
To push the model to respect this, I would like to build a custom loss function including, for each node :
1- the difference between its predicted and actual trajectory (I have this),
2- a great penalty if one neighbor is predicted to get too close (e.g. the minimum distance between node1 and node2 is lower than a prescribed threshold).
Any suggestion on how to do this second step ? I guess this would involve looping over y_preds and computing
y_prednode1, y_prednode2 differences etc. but I am not clear how to ensure I am checking connected nodes ?
Any other suggestion are welcome :-) !
Cheers !
Beta Was this translation helpful? Give feedback.
All reactions