SciML / Optimization.jl

Mathematical Optimization in Julia. Local, global, gradient-based and derivative-free. Linear, Quadratic, Convex, Mixed-Integer, and Nonlinear Optimization in one simple, fast, and differentiable interface.
https://docs.sciml.ai/Optimization/stable/
MIT License
688 stars 75 forks source link

`PolyOpt` only accept functions without any extra inputs #728

Open prbzrg opened 3 months ago

prbzrg commented 3 months ago

As docs suggest for mini-batch, the loss function can be (u, p, xs_) -> vl and it works with OptimizationOptimisers but this line in OptimizationPolyalgorithms creates errors. Does using PolyOpt have an intended restriction on the loss function?

https://github.com/SciML/Optimization.jl/blob/8310517a0b67260900a92e40c0dbb46e8ecedafc/lib/OptimizationPolyalgorithms/src/OptimizationPolyalgorithms.jl#L14

ChrisRackauckas commented 3 months ago

Oh that just needs to splat the args