Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

advanced parameter vectors #26

Open
tbeason opened this issue Jan 6, 2022 · 2 comments
Open

advanced parameter vectors #26

tbeason opened this issue Jan 6, 2022 · 2 comments

Comments

@tbeason
Copy link
Contributor

tbeason commented Jan 6, 2022

It seems the trend is to use things like LabelledArrays.jl for parameter vectors so that you get both x[i] and x.a access to values, which makes writing the objective function much much easier. Do you have any thoughts on if this is something you'd want to support and, if so, how we might go about doing so?

https://github.com/SciML/LabelledArrays.jl

https://github.com/jonniedie/ComponentArrays.jl

https://github.com/invenia/ParameterHandling.jl

@tpapp
Copy link
Owner

tpapp commented Jan 6, 2022

I will look into the packages you linked.

@tpapp
Copy link
Owner

tpapp commented Jun 24, 2022

Apologies for the delayed reply. I have been thinking about this and related issues (notably tpapp/TransformVariables.jl#13) for a while. I run into these issues all the time myself, but I do not yet have an easy solution.

I didn't test it, but I am sure that TikTak could be made to work with anything that's an ::AbstractVector. The problem is the local optimizer, eg a NLopt calls a foreign library, so at some point it needs to be converted to a bunch of Float64s, but at the same time if the objective requires labelled or component arrays, then they would need to be reconstituted.

The workaround I would suggest at the moment is making a wrapper (a callable struct) that has the information to reconstruct whatever is needed from a flat vector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants