JuliaGaussianProcesses / JuliaGaussianProcesses/KernelFunctions.jl
Calling kernelmatrix on a vector means its size becomes fixed (e.g. push! to it no longer works)
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 275
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
This might be a bug of Julia but here goes:
This does not work
X = ColVecs(rand(3, 20))
Z = collect.(X)
kernelmatrix(SqExponentialKernel(), [X[1]], Z)
push!(Z, X[1])
ERROR: cannot resize array with shared data
but this does (note the copy on Z)
X = ColVecs(rand(3, 20))
Z = collect.(X)
kernelmatrix(SqExponentialKernel(), [X[1]], copy(Z))
push!(Z, X[1])
also this does not work
X = [rand(3) for _ in 1:20]
Z = collect.(X[1:5])
kernelmatrix(SqExponentialKernel(), [X[1]], Z)
push!(Z, X[1])
Also removing the call to kernelmatrix solves the problem, and
When going to the stack trace this just leads to some ccall, so it's hard to go further....
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the Julia examples in the report, comparing the calls with Z and copy(Z). Start at kernelmatrix and follow the stack trace into the reported ccall boundary to find why Z becomes non-resizable. Done means the original Z remains resizable after kernelmatrix, while the existing kernel-matrix examples continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100