JuliaAttic / ReverseDiffSource.jl

Reverse automated differentiation from source
MIT License
47 stars 12 forks source link

Reverse AD for mod2pi() #34

Closed papamarkou closed 8 years ago

papamarkou commented 8 years ago

Hi @fredo-dedup , how easy would it be to implement reverse AD for the mod2pi() function? @eford, a collaborator, would like to make use of such functionality. Would it be possible to help with this? I don't know much about the internals of ReverseDiffSource (I only use its interface to integrate it with Lora), so it would either be you who implements it or you could give me some directions and I can try to contribute a PR :+1:

fredo-dedup commented 8 years ago

This should do :

@deriv_rule mod2pi(x::Real) x ds 

(since the derivative is always 1. ).

papamarkou commented 8 years ago

Thanks @fredo-dedup! I will open a PR later on today about this.

papamarkou commented 8 years ago

I will close this issue now, as I have opened a PR for mod2pi().