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
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
The text was updated successfully, but these errors were encountered:
I'm working on a more extensive generic interface for nested arrays that will also support the upcoming Base.Slices, that'll likely end up in ArrayInterface and will come with a general way or "inverting" a flatten operation.
Hello,
Is there a way to easily reconsitute a VectorOfVectors once it has been flattened?
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
The text was updated successfully, but these errors were encountered: