Coder Social home page Coder Social logo

arraysofarrays.jl's People

Contributors

bjarthur avatar chrhck avatar dependabot[bot] avatar juliatagbot avatar moelf avatar oschulz avatar ranocha avatar sthayashi avatar theogf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arraysofarrays.jl's Issues

sizehint! based on size of backing array

It is sometimes that case I'm constructing a VectorOfArrays and I know what size the backing array will be as well as the number of arrays they will constitute. Would it be useful to add a:

function Base.sizehint!(A::VectorOfArrays{T,N}, n, s::Int) where {T,N}

Overload for this situation? Happy to put together a PR if there's agreement this is helpful.

Performance assessment

As stated in the doc and the header of the readme.md, you claimed that this is a package " for efficient storage and handling of nested arrays.". However, you have not provided any performance evaluations! Can you please think about it and provide proof for what you've stated? How much is this efficient? Compared to what is this package efficient?

getindex(.) return type does not match eltype

First off, awesome idea/package! It's been quite useful in my own work.

I was really excited to use your package in conjunction with StructArrays but ran into an issue (that I attempted to fix with a PR to StructArrays) as explained here. The owner of that package pointed out, however, that the real issue is the following:

julia> x=nestedview(rand(2,3,10), 2);
julia> x[1] isa eltype(x)
false

What are your thoughts on modifying eltype to be consistent with the true return type of getindex?

-Colin

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!

VectorOfVectors flatview to nestedview

Hello,

Is there a way to easily reconsitute a VectorOfVectors once it has been flattened?

using ArraysOfArrays

# original VectorOfVectors 
VV = VectorOfVectors{Float64}()
push!(VV, rand(3))
push!(VV, rand2())

# need to flatten for AD 
VV_flat = flatview(VV)

# wish I could do this
VV_nested = nestedview(VV_flat)
VV_nested == VV # please be true

In my use case, it is convenient to use a VectorOfVectors since it simplifies indexing groups of parameters that relate to different aspects of a model. Sadly, ForwardDiff doesn't play nice with this structure as it wants a single vector, hence the initial flattening. I would think this is not so problematic, except that reconsituting the nested view within the function to be optimized seems complicated once dual numbers are involved.

Thanks

Incorrect/unnecessary overloads

(copied from Slack)

Here's one example:

Statistics.std(X::AbstractVectorOfSimilarArrays{T,M}; corrected::Bool = true) where {T,M} =
    std(flatview(X); corrected = corrected)
which results in the following behavior:
julia> A=rand(2,3,4);

julia> B=nestedview(A, Val(2));

julia> C=[Array(el) for el in B];

julia> std(B)
0.32135578668613923

julia> std(C)
2ร—3 Array{Float64,2}:
 0.163392  0.393621  0.343109
 0.290079  0.365516  0.135774

I think the fix for this one is easy: just remove all the overloads for now. If we continue with the plan to merge SpecialArrays/JuliennedArrays here then how dims is handled changes anyways since they both support slicing along arbitrary dimensions and not just the first M.

Support resizing of elements of VectorOfArrays

Add array type ContiguousUnitRanges or so that wraps an elem_ptr vector and presents it as a vector of ranges. Allow VectorOfArrays to use arbitrary vectors of unit-ranges as partition vector. Using ContiguousUnitRanges will then result in a memory- and performance-optimized instance with immutable elements lengths.

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.