You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
In 2D doing directions is easy. A*u vs u*A. In 3D it's harder. What you instead need to do is, for example, slice u along z and apply A*u in a loop (if u is a 3D tensor). This technique handles all directions and scales to nD. It would be nice to make it easier on the user.
I proposed something like *(A,u,1) meaning "differentiate through axis 1 (x)", etc, which would do the following:
for i in1:size(u,3)
A*view(u,:,:,i)
end
and of course generalizing to ND (the library EllipsisNotation.jl could be helpful here). Taking it to the next level, maybe we can have a macro:
@dimensional Ax*u + Ay*u + Az*u +f(x,y,z)
which interprets the multiplications as being along axis 1,2,3. That's of course far down the line.
The text was updated successfully, but these errors were encountered:
Now we can do mixed derivatives also by applying the operator along different axes. That can be an alternate implementation of composed operators instead of having 2D stencils.
Now we can do mixed derivatives also by applying the operator along different axes. That can be an alternate implementation of composed operators instead of having 2D stencils.
They are 1D stencils. It's just a funny and useful trick of linear algebra that u*A does the opposite direction stencil. By slicing along u you get matrices to then repeatedly apply the 1D stencil and do the derivative on an nD object.
In 2D doing directions is easy.
A*u
vsu*A
. In 3D it's harder. What you instead need to do is, for example, sliceu
alongz
and applyA*u
in a loop (ifu
is a 3D tensor). This technique handles all directions and scales to nD. It would be nice to make it easier on the user.I proposed something like
*(A,u,1)
meaning "differentiate through axis 1 (x)", etc, which would do the following:and of course generalizing to ND (the library EllipsisNotation.jl could be helpful here). Taking it to the next level, maybe we can have a macro:
which interprets the multiplications as being along axis 1,2,3. That's of course far down the line.
The text was updated successfully, but these errors were encountered: