Comments (6)
It seems to be an intersection of #15 and global access:
julia> const Z = Int[1,2]
2-element Array{Int64,1}:
1
2
# This works! --
julia> sparsity!([1,2],[2,3]) do du,u
Z[:] .= u[:]
du[1] = Z[1]
end
Explored path: SparsityDetection.Path(Bool[], 1)
2×2 SparseMatrixCSC{Bool,Int64} with 1 stored entry:
[1, 1] = 1
# This doesn't --
julia> sparsity!([1,2],[2,3]) do du,u
Z[:] .= u[:]
du[:] .= Z[:]
end
Explored path: SparsityDetection.Path(Bool[], 1)
2×2 SparseMatrixCSC{Bool,Int64} with 0 stored entries
from sparsitydetection.jl.
Interesting. So even the mul!
works, it's just @. DA = D*(MyA + AMx)
?
from sparsitydetection.jl.
Yes.
from sparsitydetection.jl.
I fixed the above problem,
mul!
didn't need to work, and it doesn't.
const N = 12
const My = Tridiagonal([1.0 for i in 1:N-1],[-2.0 for i in 1:N],[1.0 for i in 1:N-1])
My[1,2] = 2.0
My[end,end-1] = 2.0
function f(du,u,p,t)
mul!(du,My,u)
end
using SparsityDetection
input = rand(N,N)
output = similar(input)
sparsity_pattern = sparsity!(f,output,input,nothing,0.0)
# empty
from sparsitydetection.jl.
Ok that was actually not a problem, I screwed up while moving between branches and found a commit in the reflog which I had missed out in the #18. :/ :/
Does this look right to you for a 16x16 problem?
from sparsitydetection.jl.
It's a bit hard to do this one in my head, but that seems about right. A good test would be to calculate the full Jacobian with forward diff and then zero it out, or MTK. Of course, you can only do that on the small problems, and MTK will quickly out of memory if it's like 32x32 haha.
from sparsitydetection.jl.
Related Issues (20)
- Interpret? HOT 6
- Detection with complex fails HOT 4
- Matrix multiplication fails HOT 5
- Zero nonzeros? HOT 1
- Using a dictionary to reference indices of the input HOT 3
- Tests fail since README example fails
- y vs dx in documentation
- Jacobian sparsity detection takes a very long time and fails some times HOT 5
- Cassette error when using with Turing HOT 5
- Cassette error when adding many variables HOT 3
- error on a function with DiffEqOperators HOT 2
- type Fixed has no field value HOT 3
- Cassette error with `ODEProblem` of DifferentialEquations.jl
- MethodError: no method matching getindex(::Cassette.Tagged{...}, ::UnitRange{Int64}) HOT 2
- Why this doesn't work
- MethodError: no method matching setindex!(::Cassette.NoMetaMeta, ::Cassette.Meta{Cassette.NoMetaData,Cassette.NoMetaMeta}, ::Int64)
- Incorrect sparsity pattern on simple example HOT 1
- TagBot trigger issue HOT 1
- Failure under Julia 1.7.0-beta2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparsitydetection.jl.