danielegrattarola / spektral

Graph Neural Networks with Keras and Tensorflow 2.
https://graphneural.network
MIT License
2.37k stars 334 forks source link

Does this library support edge labeling? #18

Closed offchan42 closed 5 years ago

offchan42 commented 5 years ago

Suppose I have a bunch of points on an image that has properties like its position and color. I want to connect every point by a line and then the model should classify which line is appropriate.

For example, if a line connects between red and green point then it should be labeled 1, otherwise 0.

Which algorithm from this repo should I use?

danielegrattarola commented 5 years ago

Most GNN algorithms are designed for node labeling, so this is not something that can be immediately done in Spektral. You could try switching to the dual graph (i.e., nodes become edges and vice versa) if the size of your data allows it.

offchan42 commented 5 years ago

Suppose I have a controller like this image: image

I want to simply connect the lines from LED 1 to 2, LED 2 to 3, ... LED 8 to 9.

I have input a list of X,Y positions. The list is unordered so you cannot assume the first position on the list is for LED 1. How would you frame this problem as a graph (or other method)? I see this as a complete graph where each LED is connected to every LED, and then the graph algorithm has to label 0 on wrong connection, and 1 on correct connection (in the image there are only 8 correct connections, while the complete graph is 9x8=72 connections). Now, there can be occlusions possible. So if there are occlusions you should be able to deal with it.

danielegrattarola commented 5 years ago

I'm sorry, but I have no expertise with the particular task that you are mentioning so I can be of little help. I think you might have better luck on stackexchange.com.

I'm going to close this issue as it is not about a problem with the library or a feature request. Feel free to send me an email if you want to discuss your project.