julialang.org/blog/2016/02/iteration/
(Caveats and remarks: This article is written for mutable arrays. We do often require immutable arrays these days.
Some of the links to Julia documentation are out of date, see docs.julialang.org/en/v1/manual/arrays/ instead.
X... construction typically "splats" elements of tuple or array X, see the second half of docs.julialang.org/en/v1/manual/functions/#Varargs-Functions section for explanation and examples, starting from the words 'On the flip side, it is often handy to "splat" the values contained in an iterable collection into a function call as individual arguments'; this construction works everywhere, not just in function calls.)
(Caveats and remarks: This article is written for mutable arrays. We do often require immutable arrays these days.
Some of the links to Julia documentation are out of date, see docs.julialang.org/en/v1/manual/arrays/ instead.
X... construction typically "splats" elements of tuple or array X, see the second half of docs.julialang.org/en/v1/manual/functions/#Varargs-Functions section for explanation and examples, starting from the words 'On the flip side, it is often handy to "splat" the values contained in an iterable collection into a function call as individual arguments'; this construction works everywhere, not just in function calls.)
no subject
Date: 2021-05-13 03:36 pm (UTC)https://github.com/JuliaImages/ImageTransformations.jl/blob/master/src/warp.jl
https://github.com/JuliaImages/ImageTransformations.jl/blob/master/src/warpedview.jl
https://github.com/JuliaImages/ImageTransformations.jl/blob/master/src/invwarpedview.jl
I should at least try to read it (although I am a bit unsure about complexity; I tend to think about this rather simple-mindedly; and also - would Zygote take gradients through something like this? I am still unsure about actually calling these functions rather than implementing version(s) I have in mind).
(The official documentation to all this is absolutely minimal, namely
https://juliaimages.org/stable/pkgs/transformations/
but the functions are well-commented. Их схема более богатая; они там всякие соображения уже включили, которые накапливаются по мере того, как люди работают с этой схемой; в принципе, лучше бы пользоваться ей, если это не слишком сложно, и если оно не перестанет дифференцироваться из-за этого (e.g. we know that Zygote gradient-computing system enforces immutable arrays).
Но, с другой стороны, у них эти преобразования, в основном, линейные, и они используют этот сомнительный inv, а мы любим warp, который совсем не линеен и далеко не всегда обязан быть обратимым (хотя у нас необратимость, в основном, возникает из-за того, что мы отображаем целочисленный grid в целочисленный grid - как раз то, от чего мы хотим избавиться; но inv, всё равно, вряд ли будет работать).)