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

Add support for functions of multiple variables. #391

Open
GrigorySarnitsky opened this issue Oct 13, 2022 · 2 comments
Open

Add support for functions of multiple variables. #391

GrigorySarnitsky opened this issue Oct 13, 2022 · 2 comments

Comments

@GrigorySarnitsky
Copy link

As far as I understand, Optimization.jl is focused on minimizing a function f(u, p) where u had to be an AbstractArray of some reasonable type (i.e. not array of arrays).

This set up can handle functions of multiple uniform variables x1, x2, ..., we can put all these variables into one array [x1, x2, ...]. But what if the function depends on several vectors of different lengths and matricies? Although in reasonable applications it is likely that we can still put them into a single array, this is inconvinient. Flux.jl can handle functions of several array variables.

If I am wrong and Optimization.jl can handle explicitly functions of multiple variables, I would appreciate an example, couldn't find it in the docs.

@ChrisRackauckas
Copy link
Member

Just use an array type for that, like https://github.com/jonniedie/ComponentArrays.jl

@ChrisRackauckas
Copy link
Member

Some solvers will require flat vectors though. Handling that more nicely is something we have a solution for. SciML/DifferentialEquations.jl#881 describes some details.

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