# \[ANN\] ModelWrappers.jl - Flatten/Unflatten your Model Parameter in an Automatic Differentiation friendly way

**URL:** <https://discourse.julialang.org/t/ann-modelwrappers-jl-flatten-unflatten-your-model-parameter-in-an-automatic-differentiation-friendly-way/94401>\
**Category:** Package Announcements\
**Tags:** differentiation, bayesian-inference, modelling\
**Created:** [February 10, 2023, 9:36am UTC](https://discourse.julialang.org/t/ann-modelwrappers-jl-flatten-unflatten-your-model-parameter-in-an-automatic-differentiation-friendly-way/94401 "2023-02-10T09:36:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PatAsch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patasch/32/46746_2.png) [@PatAsch](https://discourse.julialang.org/u/PatAsch)\
**Post date:** [February 10, 2023, 9:36am UTC](https://discourse.julialang.org/t/ann-modelwrappers-jl-flatten-unflatten-your-model-parameter-in-an-automatic-differentiation-friendly-way/94401/1 "2023-02-10T09:36:31Z")

</div>

This package exists for some time now, but it is finally in a mature enough state that I wanted to share it here too. `ModelWrappers.jl` allows you to work with Model parameter either as a NamedTuple or as Vector and makes switching between those two easy and fast.

There are other packages that offer similar capabilities, for instance `ParameterHandling.jl`, which I like a lot too. If I had to argue about differences, `ModelWrappers.jl` focuses on the `unflatten(vector) -> NamedTuple` part, whereas the ParameterHandling.jl focuses on `flatten(NamedTuple) -> Vector` part. This also initially led me to create this package.

A repository URL with more detailed documentation can be found here: [GitHub - paschermayr/ModelWrappers.jl: ModelWrappers.jl is a utility package that makes it easier to work with Model parameters stated as (nested) NamedTuples.](https://github.com/paschermayr/ModelWrappers.jl)

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [February 10, 2023, 12:24pm UTC](https://discourse.julialang.org/t/ann-modelwrappers-jl-flatten-unflatten-your-model-parameter-in-an-automatic-differentiation-friendly-way/94401/2 "2023-02-10T12:24:49Z")

</div>

There is also [GitHub - JuliaNonconvex/DifferentiableFlatten.jl: Zygote-differentiable way of flattening and unflattening data structures](https://github.com/JuliaNonconvex/DifferentiableFlatten.jl).
