-
Notifications
You must be signed in to change notification settings - Fork 47
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
Weights not included in GNNGraph made from SimpleWeightedDiGraph #85
Comments
SimpleWeightedGraphs.jl is not supported yet. We can add support if think people it is convenient, although I would avoid adding another dependence to this package if possible. Right now you can create a weighted graph explicitly passing source, target and weights to the constructor: julia> g = rand_graph(5, 10, bidirected=true)
GNNGraph:
num_nodes = 5
num_edges = 10
julia> s, t = edge_index(g)
([1, 1, 2, 2, 4, 4, 5, 4, 5, 5], [4, 5, 4, 5, 5, 1, 1, 2, 2, 4])
julia> w = rand(5);
julia> w = [w; w] # same weight in both directions;
julia> gweighted = GNNGraph(s, t, w)
GNNGraph:
num_nodes = 5
num_edges = 10
julia> gweighted.graph
([1, 1, 2, 2, 4, 4, 5, 4, 5, 5], [4, 5, 4, 5, 5, 1, 1, 2, 2, 4], [0.7349537135631546, 0.33820014607400384, 0.08459031049266375, 0.03523075347974425, 0.8861075693177956, 0.7349537135631546, 0.33820014607400384, 0.08459031049266375, 0.03523075347974425, 0.8861075693177956]) Is this convenient enough for you? Also, right now only |
Ah, it's not critical for SimpleWeightedGraphs.jl to be supported in my case, just making sure that this was intentional. GCNConv is how I was planning on using edge weights. |
Reopening this as we don't support construction from WeightedGraphs yet |
This could be implemented as a package extension |
Hello, just found your sweet package!
I ran into a minor issue when wrapping a SimpleWeightedDiGraph with a GNNGraph. The weights from the DiGraph are not included in the wrapped graph.
Below is an MWE of this behavior. I'm not certain if this was by design.
RETURNS
The text was updated successfully, but these errors were encountered: