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
As shown in #146, if the user inputs a 3x3 Diagonal matrix, we currently create a dense Matrix of tracers with input indices 1 to 9.
This leads to non-conservative sparsity patterns:
julia> x =Diagonal(rand(3))
3×3 Diagonal{Float64, Vector{Float64}}:0.674044⋅⋅⋅0.683069⋅⋅⋅0.387561
julia>jacobian_sparsity(sum, x, TracerSparsityDetector())
1×9 SparseArrays.SparseMatrixCSC{Bool, Int64} with 9 stored entries:111111111
Even worse, the user-provided function is called with a Matrix of tracers instead of a Diagonal of tracers, likely hitting an entirely different method.
For the example above, a custom trace_input method should be implemented that returns a Diagonal matrix of three tracers with indices 1, 5 and 9.
The text was updated successfully, but these errors were encountered:
While Diagonal is easily fixed, Symmetric is much more tricky:
For a 3x3 Symmetric matrix, we actually want to create 9 tracers with input indices 1 to 9. However, the returned matrix can't be symmetric!
As shown in #146, if the user inputs a 3x3
Diagonal
matrix, we currently create a denseMatrix
of tracers with input indices 1 to 9.This leads to non-conservative sparsity patterns:
Even worse, the user-provided function is called with a
Matrix
of tracers instead of aDiagonal
of tracers, likely hitting an entirely different method.For the example above, a custom
trace_input
method should be implemented that returns aDiagonal
matrix of three tracers with indices 1, 5 and 9.The text was updated successfully, but these errors were encountered: