David Widmann
David Widmann
I see the following possibilities here: - define a custom adjoint for `_map(::FunctionTransform, ...)` - define a custom adjoint for `mapslices` in ChainRules (see https://github.com/FluxML/Zygote.jl/issues/92) - use `SliceMap` (see https://github.com/FluxML/Zygote.jl/issues/92)...
A bit off topic, but splatting probably impacts performance quite a bit, so probably it would b better to use `mapreduce(x -> sin.(x), hcat, ...)`. For benchmarks you also want...
Shouldn't you use `eachslice(...; dims=2)` or `eachcol`?
Can you check if the function is typestable? I suspect it might not, which would explain the number of allocations. The problem might be that it returns a different type...
KernelFunctions doesn't use `mapslices` anymore, so for this projects custom adjoints for `mapslices` are not required anymore. Nevertheless, an implementation of an adjoint of `mapslices` in ChainRules requires a solution...
The latest releases don't use `mapslices`, it was replaced in https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/pull/152. I guess you can use something similar instead of `mapslices` in Stheno as well.
You can use https://github.com/JuliaDiff/ForwardDiff.jl/pull/451 if you do not want to edit the source code.
I came across https://www.tandfonline.com/doi/pdf/10.1080/10652469.2016.1164156 [a while ago](https://github.com/JuliaDiff/ChainRules.jl/issues/208#issue-639625677), it contains closed-form expressions of the derivatives using e.g. hypergeometric functions. In principle these could be used with other AD backends as well...
> By using only we could get rid of a lot of the length(v) = = 1 I know, and initially I used it in some places :slightly_smiling_face: However, it...
I would be fine with this but I didn't want to make this change without prior discussion. Also I assume Julia 1.6 might be the LTS before this PR is...