joschu / cgt

Computation Graph Toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in graph simplification

sbos opened this issue · comments

I have a baseline parameter in my program which is subtracted from gradients and not used to compute the actual function I'm optimizing. However, changing that parameter affects not just gradient computation, but the returned function value as well.
This behaviour is present only if enable_simplification = True.

The code is here https://gist.github.com/sbos/65ea08d5885660625fd3
The three values it prints should be nearly equal, but setting enable_simplification = True makes the second one close to zero.

Thanks for pointing out this bug with a simple code example. I'm looking into it now.

Oops, I misspoke in my recent commit -- I fixed a bug in the in-place optimization, but there's still a problem with your script. I'll keep at it...

(This part of the code needs MUCH more careful testing/specification/documentation, I know)