Skip to content

Commit 4a0c5e8

Browse files
Merge pull request #791 from SciML/optdocsbump
Update docstrings for Optimization v4
2 parents 012ff4e + 910d731 commit 4a0c5e8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SciMLBase"
22
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
33
authors = ["Chris Rackauckas <[email protected]> and contributors"]
4-
version = "2.53.1"
4+
version = "2.53.2"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

src/problems/optimization_problems.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Any extra keyword arguments are captured to be sent to the optimizers.
6666
6767
* `f`: the function in the problem.
6868
* `u0`: the initial guess for the optimization variables.
69-
* `p`: the constant parameters used for defining the problem. Defaults to `NullParameters`.
69+
* `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`.
7070
* `lb`: the lower bounds for the optimization variables `u`.
7171
* `ub`: the upper bounds for the optimization variables `u`.
7272
* `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
9090
9191
Note that these vectors must be sized to match the number of constraints, with one set of conditions for each constraint.
9292
93+
## Data handling
94+
95+
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.
96+
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/).
9397
"""
9498
struct OptimizationProblem{iip, F, uType, P, LB, UB, I, LC, UC, S, K} <:
9599
AbstractOptimizationProblem{iip}

src/scimlfunctions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ A representation of an objective function `f`, defined by:
17841784
```
17851785
17861786
and all of its related functions, such as the gradient of `f`, its Hessian,
1787-
and more. For all cases, `u` is the state and `p` are the parameters.
1787+
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.
17881788
17891789
## Constructor
17901790

0 commit comments

Comments
 (0)