Git Product home page Git Product logo

fluxdiffutils.jl's People

Contributors

jlchan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fluxdiffutils.jl's Issues

Consistency in API

Would like the matrices returned by the hadamard_* functions (in particular hadamard_jacobian) to be compatible with the vector of vectors, U, used to construct them.

specialize `hadamard_jacobian` writing to sparse matrices

Should write directly to nzval in Jacobian blocks instead of using A[i,j] access. The latter is slow, see MWE

function copy_sparse!(A,B)
    rows = rowvals(B)
    vals = nonzeros(B)
    for j = 1:size(B,2)
        for row_id in nzrange(B,j)
            i = rows[row_id]
            # modify B_ij = f(B_ij,i,j) ...
            A[i,j] = vals[row_id]
            # A.nzval[row_id] = vals[row_id] # faster
        end
    end
end

Running with N=1000 matrices (both dense/sparse) shows sparse writes are much slower.

julia> @btime copy_sparse!($Asparse,$B);
  11.801 μs (0 allocations: 0 bytes)

julia> @btime copy_sparse!($Adense,$B);
  2.049 μs (0 allocations: 0 bytes)

Remove "scale" argument

Fix so that users don't need to specify "scale = +/- 1", just the matrix type (symmetric, skew-symmetric, or general).

Type instability in `hadamard_jacobian` from construction of block matrix

Line 75 of hadamard_jacobian.jl causes the function hadamard_jacobian(A_list, product_type...) to be type unstable. The instability can be recreated with the following snippet of code:

    function makeBlockJ(U)
        Nfields = length(U)
        n = length(U[1])
        Z = spzeros(n,n)
        J = SMatrix{Nfields,Nfields}( [Z for i in 1:Nfields, j in 1:Nfields])
    end
    @code_warntype makeBlockJ(U)

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Name change

Thinking of changing name to FluxDiffUtils.jl, since the new hadamard_sum for dense operators is general purpose.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.