mstksg / backprop

Heterogeneous automatic differentiation ("backpropagation") in Haskell
https://backprop.jle.im
BSD 3-Clause "New" or "Revised" License
181 stars 22 forks source link

Does generic-lens help backprop? #11

Closed vincent-hui closed 5 years ago

vincent-hui commented 6 years ago

Just a simple thought. Is using generic-lens beneficial to backprop? I don't have an answer.

mstksg commented 5 years ago

It seems like it's useful for making the lenses that you can use :) Otherwise I think it's the same situation as using template haskell-based lenses. Maybe it might be worth suggesting as a solution for making lenses, instead of using template haskell. However, I do suspect that generics-based lenses might necessarily be less performant than template haskell-based lenses, since generics requires O(n) field access, while template-haskell is O(1).

mstksg commented 5 years ago

Not closing this to say that the previous reply was a final word; just cleaning up some of the issues :) Feel free to continue discussion.