-
Notifications
You must be signed in to change notification settings - Fork 12
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
Tensor Functions #11
Comments
Hi, I had no plans for this but yes this is possible. Calculation time should be O(n). It would need some prior thinking on how to present the results, especially for higher order derivations. Don't know if this would work for you, but you have a workaround with the current version :
|
Hi Frédéric, thank you for your quick reply. I'll try your workaround when I find the time, as I'm currently involved in another project. As far as I can tell, the workaround provides for the differentiation of tensor-valued functions with respect to scalars, however, I'm sure it could be extended to more complicated structures. Just FYI, what I'd ideally be looking for is the computation of partial and/or total derivatives of functionals of the type Best regards, |
FYI, if just writing down all the gradients of lots of tensor-valued functions is the blocker, this has been done (at least twice) in the autograd-family of libraries. In autograd: https://github.com/HIPS/autograd/blob/master/autograd/numpy/numpy_grads.py EDIT: the most confusing gradients for those exhaustive links above are those having to do with tensor resizing, indexing and broadcasting. I'm happy to help, and walk through the code with anyone interested in porting them to Julia, if that's interesting to someone. |
@alexbw I'm definitely interested to port tensor gradients to Julia (e.g. see dfdx/Espresso.jl#2 for some details). Would you suggest any "entry point" to get started (either in code or in theoretical papers)? |
On the issue you linked, I think you're conflating the partial derivatives I would recommend just lifting the gradients from autograd or On Sun, Aug 14, 2016 at 12:29 PM Andrei Zhabinski [email protected]
|
@alexbw Thanks for your answer. For the code you linked, am I right saying that gradients there are represented as Python/Lua functions that take previous gradients (i.e. gradients of arguments) and produce a new gradient for the current operation itself? That is something like this:
Also I don't really understand meaning of so common |
Yes, the function signature, for some function like e.g. sum(x,y): gradSum[1] = function(incomingGradient, answerOfSum, x, y) ... end to calculate the partial gradients for each argument of sum(x,y) Unbroadcast (used to be called "sumToMatchShape") is used a lot to match On Tue, Aug 16, 2016 at 7:01 PM Andrei Zhabinski [email protected]
|
Hi Frédéric,
as far as I can tell, the package currently only supports functions that yield a scalar value. Any plans on extending this to tensor-valued functions of tensors?
Best regards,
Robert
The text was updated successfully, but these errors were encountered: