Conversation
| ) | ||
| # For complex numbers, we need to perturb real and imaginary parts separately | ||
| if elT <: Complex | ||
| real_perturbation = complex.(perturbation, zero(perturbation)) |
There was a problem hiding this comment.
so we need to be careful here because forward and reverse mode should have different conventions here. see : https://enzymead.github.io/Enzyme.jl/stable/faq/#Complex-numbers
I think this is equivalent to forward mode
There was a problem hiding this comment.
should we document this is only valid for holomorphic functions?
There was a problem hiding this comment.
yeah, or at least we should document the convention [which ofc for holomorphic is equivalent across all conventions]
There was a problem hiding this comment.
actually I don't think that's the case, are you passing in the equivalent of 1+1im ? [except onehot]
There was a problem hiding this comment.
1 + 0i and 0 + 1i
There was a problem hiding this comment.
ah, I guess I'm not understanding how we combine them then for the final answer?
There was a problem hiding this comment.
similar to how FiniteDiff does it https://github.com/JuliaDiff/FiniteDiff.jl/blob/f37d23dd0e3eba050309fd1d0e88be0bb53867e3/src/gradients.jl#L327-L337
1a880a5 to
34179c5
Compare
34179c5 to
a340b14
Compare
a340b14 to
eac1c7c
Compare
No description provided.