Skip to content

Commit

Permalink
Resolve the m-n-d confusion. The number of residuals/components in LM…
Browse files Browse the repository at this point in the history
… is now unified to m.
  • Loading branch information
kellertuer committed Jan 3, 2025
1 parent 98ded01 commit 0e7cd4d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/documentation_glossary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ define!(
:NonLinearLeastSquares,
(; M="M", p="p") -> """
```math
$(_tex(:argmin))_{$p$(_math(:M; M=M))} $(_tex(:frac,1,2)) $(_tex(:sum))_{i=1}^n $(_tex(:abs, "f_i($p)"))^2
$(_tex(:argmin))_{$p$(_math(:M; M=M))} $(_tex(:frac,1,2)) $(_tex(:sum))_{i=1}^m $(_tex(:abs, "f_i($p)"))^2
```
where ``f: $(_math(:M; M=M)) → ℝ^n`` is written with component functions ``f_i: $(_math(:M; M=M)) → ℝ``,
where ``f: $(_math(:M; M=M)) → ℝ^m`` is written with component functions ``f_i: $(_math(:M; M=M)) → ℝ``, ``i=1,…,m``,
and each component function is continuously differentiable.
""",
)
Expand Down
2 changes: 1 addition & 1 deletion src/plans/nonlinear_least_squares_plan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ _doc_get_residuals_nlso = """
get_residuals(M::AbstractManifold, nlso::NonlinearLeastSquaresObjective, p)
get_residuals!(M::AbstractManifold, V, nlso::NonlinearLeastSquaresObjective, p)
Compute the vector of residuals ``f_i(p)``, ``i=1,…,n`` given the manifold `M`,
Compute the vector of residuals ``f_i(p)``, ``i=1,…,m`` given the manifold `M`,
the [`NonlinearLeastSquaresObjective`](@ref) `nlso` and a current point ``p`` on `M`.
"""

Expand Down
14 changes: 7 additions & 7 deletions src/solvers/LevenbergMarquardt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ The second block of signatures perform the optimization in-place of `p`.
# Input
$(_var(:Argument, :M; type=true))
* `f`: a cost function ``f: $(_math(:M))→ℝ^d``.
* `f`: a cost function ``f: $(_math(:M))→ℝ^m``.
The cost function can be provided in two different ways
* as a single function returning a vector ``f(p) ∈ ℝ^d``
* as a single function returning a vector ``f(p) ∈ ℝ^m``
* as a vector of functions, where each single function returns a scalar ``f_i(p) ∈ ℝ``
The type is determined by the `function_type=` keyword argument.
* `jacobian_f`: the Jacobian of ``f``.
The Jacobian can be provided in three different ways
* as a single function returning a vector of gradient vectors ``$(_tex(:grad)) f_i(p)``
* as a vector of functions, where each single function returns a gradient vector ``$(_tex(:grad)) f_i(p)``
* as a single function returning a (coefficient) matrix with respect to an [`AbstractBasis`](@extref `ManifoldsBase.AbstractBasis`)
of the tangent space at `p`.
* as a single function returning a vector of gradient vectors ``$(_tex(:bigl))($(_tex(:grad)) f_i(p)$(_tex(:bigr)))_{i=1}^m
* as a vector of functions, where each single function returns a gradient vector ``$(_tex(:grad)) f_i(p)``, , ``i=1,…m``
* as a single function returning a (coefficient) matrix ``J ∈ ℝ^{m×d}``, where ``d`` is the dimension of the manifold.
These coefficients are given with respect to an [`AbstractBasis`](@extref `ManifoldsBase.AbstractBasis`) of the tangent space at `p`.
The type is determined by the `jacobian_type=` keyword argument.
$(_var(:Argument, :p))
* `num_components`: length of the vector returned by the cost function (`d`).
* `num_components`: length ``m`` of the vector returned by the cost function.
By default its value is -1 which means that it is determined automatically by
calling `f` one additional time. This is only possible when `evaluation` is [`AllocatingEvaluation`](@ref),
for mutating evaluation this value must be explicitly specified.
Expand Down

0 comments on commit 0e7cd4d

Please sign in to comment.