Optimisation usually goes from R^n into R yes, I’m not familiar with ArrayPartition but if you just have two vectors to split/join it’s not that bad to do it by hand.
It is a bit unintuitive to have parameter dimensions as function arguments
You can get them inside your function from size
instead of passing them as parameters. Just avoid non-constant globals (and personally I would add: avoid globals altogether).
it remains to be seen how long that will take
You’d better time your error function with @time
and set a limit of function evaluations by passing Optim.Options(f_calls_limit=x)
to optimize
, otherwise you might end up waiting for days. It seems there’s also a time_limit
option.
http://julianlsolvers.github.io/Optim.jl/stable/user/config/#general-options