Closed darrenjw closed 4 years ago
@darrenjw sorry that I missed the discussion in the gitter channel!
y.gradient
should be correct relative to the ordering in y.variables
. That ordering is non-deterministic. In the withGradient
case you're providing a specific ordering of the variables, which it is respecting.
Does that help?
OK, I see - I missed ".variables". That does make sense. Thanks!
If my understanding of how gradient evaluation works is correct (and it may not be), I think there may be a bug in the evaluation of gradients (without compilation), apparently leading to switched gradient components in some cases. A minimal reproducible example/test is given below, for the project
rainierCore
on the current head of thedevelop
branch, though the problem also affects the current release.Both
egd
andcdg
should contain grady
.cgd
is correct, butegd
has the first two elements switched.A version of the above with more explanation can be found on the gitter channel (posted 1st January 2020).