-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add with_inverse(f, x)
?
#6
Comments
I think it would be good to see some concrete implementations for ParameterHandling and one or two other packages first. This would make it easier to evaluate its usefulness and potential problems. |
You mean implement a |
Yes, or implement |
Oh, sure, makes sense. |
Looks like this functionality is already present in with_inverse(f, x) = f(x), y -> set(x, f, y)
f = @optic exp(_.field[2]) # just an example f
y, inverse_f = with_inverse(f, x) Of course, defining this |
Thanks @aplavin - I guess we should close this for now, then, until use cases come up that really can't separate forward and inverse calculation without significant overhead. |
Maybe we should add an interface
y, inverse_f = with_inverse(f, x)
, to support use cases that can't generate an inverse function withoutx
(like a generic flatten-to-real-vector function, see JuliaGaussianProcesses/ParameterHandling.jl#43).The default implementation would simply be
so it wouldn't make InverseFunctions noticeably heavier.
The text was updated successfully, but these errors were encountered: