-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce AbstractApproximationMethod (#177)
* Initial sketch of an abstract estimation method type. * Rename AbstractEstimationMethod to AbstractApproximationMethod * Fix docs. * Update our reference. --------- Co-authored-by: Mateusz Baran <[email protected]>
- Loading branch information
1 parent
f5d3189
commit 65780dc
Showing
12 changed files
with
264 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
@doc raw""" | ||
AbstractApproximationMethod | ||
Abstract type for defining estimation methods on manifolds. | ||
""" | ||
abstract type AbstractApproximationMethod end | ||
|
||
@doc raw""" | ||
GradientDescentEstimation <: AbstractApproximationMethod | ||
Method for estimation using [📖 gradient descent](https://en.wikipedia.org/wiki/Gradient_descent). | ||
""" | ||
struct GradientDescentEstimation <: AbstractApproximationMethod end | ||
|
||
@doc raw""" | ||
CyclicProximalPointEstimation <: AbstractApproximationMethod | ||
Method for estimation using the cyclic proximal point technique, which is based on [📖 proximal maps](https://en.wikipedia.org/wiki/Proximal_operator). | ||
""" | ||
struct CyclicProximalPointEstimation <: AbstractApproximationMethod end | ||
|
||
@doc raw""" | ||
EfficientEstimator <: AbstractApproximationMethod | ||
Method for estimation in the best possible sense, see [📖 Efficiency (Statictsics)](https://en.wikipedia.org/wiki/Efficiency_(statistics)) for more details. | ||
This can for example be used when computing the usual mean on an Euclidean space, which is the best estimator. | ||
""" | ||
struct EfficientEstimator <: AbstractApproximationMethod end | ||
|
||
|
||
@doc raw""" | ||
ExtrinsicEstimation{T} <: AbstractApproximationMethod | ||
Method for estimation in the ambient space with a method of type `T` and projecting the result back | ||
to the manifold. | ||
""" | ||
struct ExtrinsicEstimation{T<:AbstractApproximationMethod} <: AbstractApproximationMethod | ||
extrinsic_estimation::T | ||
end | ||
|
||
@doc raw""" | ||
WeiszfeldEstimation <: AbstractApproximationMethod | ||
Method for estimation using the Weiszfeld algorithm, compare for example the computation of the | ||
[📖 Geometric median](https://en.wikipedia.org/wiki/Geometric_median). | ||
""" | ||
struct WeiszfeldEstimation <: AbstractApproximationMethod end | ||
|
||
@doc raw""" | ||
GeodesicInterpolation <: AbstractApproximationMethod | ||
Method for estimation based on geodesic interpolation. | ||
""" | ||
struct GeodesicInterpolation <: AbstractApproximationMethod end | ||
|
||
@doc raw""" | ||
GeodesicInterpolationWithinRadius{T} <: AbstractApproximationMethod | ||
Method for estimation based on geodesic interpolation that is restricted to some `radius` | ||
# Constructor | ||
GeodesicInterpolationWithinRadius(radius::Real) | ||
""" | ||
struct GeodesicInterpolationWithinRadius{T<:Real} <: AbstractApproximationMethod | ||
radius::T | ||
function GeodesicInterpolationWithinRadius(radius::T) where {T<:Real} | ||
radius > 0 && return new{T}(radius) | ||
return throw( | ||
DomainError("The radius must be strictly postive, received $(radius)."), | ||
) | ||
end | ||
end | ||
|
||
@doc raw""" | ||
default_approximation_method(M::AbstractManifold, f) | ||
default_approximation_method(M::AbtractManifold, f, T) | ||
Specify a default estimation method for an [`AbstractManifold`](@ref) and a specific function `f` | ||
and optionally as well a type `T` to distinguish different (point or vector) representations on `M`. | ||
By default, all functions `f` call the signature for just a manifold. | ||
The exceptional functions are: | ||
* `retract` and `retract!` which fall back to [`default_retraction_method`](@ref) | ||
* `inverse_retract` and `inverse_retract!` which fall back to [`default_inverse_retraction_method`](@ref) | ||
* any of the vector transport mehods fall back to [`default_vector_transport_method`](@ref) | ||
""" | ||
default_approximation_method(M::AbstractManifold, f) | ||
default_approximation_method(M::AbstractManifold, f, T) = default_approximation_method(M, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
65780dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
65780dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/97189
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: