Skip to content
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

Fix heteroconv aggregation + tests #333

Merged
merged 2 commits into from
Sep 3, 2023

Conversation

svilupp
Copy link
Contributor

@svilupp svilupp commented Sep 3, 2023

Fixes #332

Proposal:

  • adds unique() to _reduceby_node_t to construct a valid tuple
  • unique operation is blocked from ChainRulesCore
  • adds tests for HeteroGraphConv aggregation

Question:

  • Are you okay with this implementation?
  • Is there a cleaner way to avoid trying to take gradients over unique? (I didn't want to block the whole signature, because it's a fairly generic one)

@CarloLucibello
Copy link
Owner

Nice, seems the right thing to do! Also very well tested, thanks.

@CarloLucibello
Copy link
Owner

Is there a cleaner way to avoid trying to take gradients over unique? (I didn't want to block the whole signature, because it's a fairly generic one)

The current solution is fine and we can merge as it is. At some point unique will be fixed by JuliaDiff/ChainRules.jl#736

@svilupp
Copy link
Contributor Author

svilupp commented Sep 3, 2023

I've checked the nightly error.
It's in the same file as I've changed ("test/layers/heteroconv.jl"), but it seems to be unrelated. It passes locally on 1.10 beta2 and 1.9.3.

Error comes from outside the tests in the gradient() call, probably because of the getindex access?

grad, dx = gradient((model, x) -> sum(model(g, x)[1]) + sum(model(g, x)[2].^2), model, x)

Error:

HeteroGraphConv: Error During Test at /home/runner/work/GraphNeuralNetworks.jl/GraphNeuralNetworks.jl/test/layers/heteroconv.jl:1
Got exception outside of a @test
Can't differentiate boundscheck expression $(Expr(:boundscheck)).
You might want to check the Zygote limitations documentation.
https://fluxml.ai/Zygote.jl/latest/limitations

@CarloLucibello
Copy link
Owner

Flux itself is failing on nightly so at the moment I'm not paying attention to it.

@CarloLucibello CarloLucibello merged commit a0797e5 into CarloLucibello:master Sep 3, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HeteroGraphConv bug: ERROR: duplicate field name in NamedTuple: "movie" is not unique
2 participants