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-08 08:50 pm (UTC)I am using a "warp" technique for wave effects in images, where I change the indices in a discrete way. e.g.
function warp3(x, y, knob) # 0:31 clip(n, nsize) = max(min(nsize, n), 1) (x0, y0) = (clip(convert(Int, floor(x + 10 * ((knob - 16) / 16) * sin(y/4))), xsize), y) # normalize to get +/- img[x0, y0] endAll this needs to be refactored anyway:
https://github.com/anhinga/julia-notebooks/blob/main/grimoire-team/design-notes.md
But one thing I have noticed is that this cannot be meaningfully differentiated with respect to parameters such as knob. And what if I want to do some gradient descent with respect to knob?
Then I should do better than this. It does not have to be completely smooth, it can have breaks in the derivative, like in ReLU. But it should be a continuous function from knob.