GeometricFlux.jl
GeometricFlux.jl copied to clipboard
Question: Is differentiation w.r.t graph supported?
For a project involving sensitivity analysis, I'd like to take the gradient of a GNN w.r.t to its inputs. Is this currently supported in GeometricFlux? If not, what would be blockers to add it? (I assume it'd have to do with the interaction of LightGraphs, Zygote and any sparsity tricks used?)
If the GNN model is support in GeometricFlux, you can get gradient by Zygote. To my curiosity, what GNN model do you want for your project specifically?
I want to study the effect of modifying edge weights and adding/removing edges across different GNNs, for this I need the gradient w.r.t to edges. (i.e., I want to check $\nabla_A h_{l+1}=MLP(h_l)+MLP(AH_{l})$ )
Unfortunately, GNN models in this repo are not that much. If you want to change the edge weight of a graph, you may want to try GCN. If you want to change the edge weight as a feature on edge, there is no GNN model supporting edge feature in this repo.
thank your very much for the information. But to clarify, if I use a weighted graph with e.g. $A=[0 1 0.5; 1 0 0 ;0.5 0 0]$, I will be able to get the dependence of an output towards that edge? Or will the gradient be lost due to some operation not tracked by Zygote?
If you already have a weighted graph and pertub the edge weight, it is possible to get the dependence of output. If the operation is not supported by Zygote, the gradient will not be generated.