diff --git a/Project.toml b/Project.toml index 6a3e3f191..c6f8bdd58 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "2.53.1" +version = "2.53.2" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/src/problems/optimization_problems.jl b/src/problems/optimization_problems.jl index 176f9f116..b5e66482d 100644 --- a/src/problems/optimization_problems.jl +++ b/src/problems/optimization_problems.jl @@ -66,7 +66,7 @@ Any extra keyword arguments are captured to be sent to the optimizers. * `f`: the function in the problem. * `u0`: the initial guess for the optimization variables. -* `p`: the constant parameters used for defining the problem. Defaults to `NullParameters`. +* `p`: Either the constant parameters or fixed data (full batch) used in the objective or a [MLUtils](https://github.com/JuliaML/MLUtils.jl) [`DataLoader`](https://juliaml.github.io/MLUtils.jl/stable/api/#MLUtils.DataLoader) for minibatching with stochastic optimization solvers. Defaults to `NullParameters`. * `lb`: the lower bounds for the optimization variables `u`. * `ub`: the upper bounds for the optimization variables `u`. * `int`: integrality indicator for `u`. If `int[i] == true`, then `u[i]` is an integer variable. @@ -90,6 +90,10 @@ Inequality constraints are then given by making `lcons[i] != ucons[i]`. For exam Note that these vectors must be sized to match the number of constraints, with one set of conditions for each constraint. +## Data handling + +As described above the second argument of the objective definition can take a full batch or a [`DataLoader`](https://juliaml.github.io/MLUtils.jl/stable/api/#MLUtils.DataLoader) object for mini-batching which is useful for stochastic optimization solvers. Thus the data either as an Array or a `DataLoader` object should be passed as the third argument of the `OptimizationProblem` constructor. +For an example of how to use this data handling, see the `Sophia` example in the [Optimization.jl documentation](https://docs.sciml.ai/Optimization/dev/optimization_packages/optimization) or the [mini-batching tutorial](https://docs.sciml.ai/Optimization/dev/tutorials/minibatch/). """ struct OptimizationProblem{iip, F, uType, P, LB, UB, I, LC, UC, S, K} <: AbstractOptimizationProblem{iip} diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index cb242a2b4..586ebebb7 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -1784,7 +1784,7 @@ A representation of an objective function `f`, defined by: ``` and all of its related functions, such as the gradient of `f`, its Hessian, -and more. For all cases, `u` is the state and `p` are the parameters. +and more. For all cases, `u` is the state which in this case are the optimization variables and `p` are the fixed parameters or data. ## Constructor