Closed martin-krutsky closed 6 months ago
Hi, thanks for reporting the bug.
It's caused by adding self-loops, which do not have assigned values:
h0__edge(I, I).
h0__edge(I, J) :- edge(I, J). [transformation=identity]
h0__edge/2 [transformation=identity]
h0__edge_count(I, J) :- h0__edge(J, X). [transformation=identity, aggregation=count]
h0__edge_count(I, J) :- h0__edge(I, X). [transformation=identity, aggregation=count]
h0__edge_count/2 [transformation=inverse, combination=product]
{3, 1} h0(I) :- node(J), h0__edge(J, I), sqrt(h0__edge_count(J, I)). [transformation=identity, combination=product, aggregation=sum]
h0/1 [transformation=identity]
@GustikS Do we just put 1.0 as its value? Hopefully, it should be fine with other edges having different shapes.
Hi, thanks both.
ha, so this is the new (recent) GCN version with normalization (self-loops)... yes, I'd add them with value 1.0 (same as PyG?) Btw. I'm missing the previous unnormalized version then (there should be flags in the constructor?)
In any case, I've updated the backend to draw templates even with null weights... the GCN template draws fine then: https://github.com/GustikS/NeuraLogic/commit/042bf9edec0031f970f12a2f890248d0736d462c
But I think there might be some other (unrelated) problem with the graphviz, as I was getting some similar error after updating to the new version while just initializing/importing things... but unable to reproduce anymore (perhaps Martin does), but that's a possibly different issue, so this one can be closed I guess..?
I can't really speak about the initialization problems, but then I would guess it is more about Graphviz than neuralogic, see, e.g., this discussion. Feel free to close this issue, if it seems to be working now.
@martin-krutsky Should be fixed in version 0.7.13. Can you confirm it works fine?
Yes, drawing the GCNConv template works now. Thanks!
Describe the bug
On Windows, when using the
Template.draw
method, I get the following error even though I have GraphViz installed and added to the Path (I tried out both System and User path variables):The exception seems to be at least misleading, as can be seen from the two examples below.
Steps to reproduce the behavior
While the following small example works just fine:
possibly suggesting the problem is not with Path or Graphviz, the next example throws the error above:
Expected behavior
Drawing the graph representation of the template.
Environment
Windows 11 Home 10.0.22631 Python 3.12.3 neuralogic 0.7.11 torch 2.2.2 torch-geometric 2.5.2
Additional context
No response