Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Special adjoint for broadcasted literal pow
Currently taking the gradient of anything that contains a broadcasted literal pow adds RefValue{typeof(^)}(^) and a similar entry for the literal power itself to the IdDict. This is probably because of the special signature in the broadcasting machinery: ``` Base.broadcasted(Base.literal_pow, Main.:^, 2, %2) ``` where %2 is a Val{N} instance. By adding a special adjoint for broadcasting literal_pow, not only do we reduce the noise in the param's IdDict, but it also speeds up taking the gradient of basic loss functions like sum(err.^2).
- Loading branch information