Skip to content

Commit

Permalink
Merge pull request #791 from SciML/optdocsbump
Browse files Browse the repository at this point in the history
Update docstrings for Optimization v4
  • Loading branch information
Vaibhavdixit02 authored Sep 20, 2024
2 parents 012ff4e + 910d731 commit 4a0c5e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SciMLBase"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
authors = ["Chris Rackauckas <[email protected]> and contributors"]
version = "2.53.1"
version = "2.53.2"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
6 changes: 5 additions & 1 deletion src/problems/optimization_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion src/scimlfunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a0c5e8

Please sign in to comment.