Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The file was started with Version `0.4`.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.34] March 3, 2026

### Fixed

* `Float32` support in `trust_regions` solver was broken in the previous release, which is now fixed.

## [0.5.33] February 18, 2026

### Added
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Manopt"
uuid = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
version = "0.5.33"
version = "0.5.34"
authors = ["Ronny Bergmann <manopt@ronnybergmann.net>"]

[workspace]
Expand Down
52 changes: 39 additions & 13 deletions src/solvers/trust_regions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -436,20 +436,20 @@ function trust_regions!(
retraction_method::AbstractRetractionMethod = default_retraction_method(M, typeof(p)),
stopping_criterion::StoppingCriterion = StopAfterIteration(1000) |
StopWhenGradientNormLess(1.0e-6),
max_trust_region_radius::R = sqrt(manifold_dimension(M)),
trust_region_radius::R = max_trust_region_radius / 8,
max_trust_region_radius::Real = sqrt(manifold_dimension(M)),
trust_region_radius::Real = max_trust_region_radius / 8,
randomize::Bool = false, # Deprecated, remove on next release (use just `σ`)
project!::Proj = (copyto!),
ρ_prime::R = 0.1, # Deprecated, remove on next breaking change (use `acceptance_rate``)
acceptance_rate::R = ρ_prime,
ρ_regularization = 1.0e3,
θ::R = 1.0,
κ::R = 0.1,
σ = randomize ? 1.0e-3 : 0.0,
reduction_threshold::R = 0.1,
reduction_factor::R = 0.25,
augmentation_threshold::R = 0.75,
augmentation_factor::R = 2.0,
ρ_prime::Real = 0.1, # Deprecated, remove on next breaking change (use `acceptance_rate`)
acceptance_rate::Real = ρ_prime,
ρ_regularization::Real = 1.0e3,
θ::Real = 1.0,
κ::Real = 0.1,
σ::Real = randomize ? 1.0e-3 : 0.0,
reduction_threshold::Real = 0.1,
reduction_factor::Real = 0.25,
augmentation_threshold::Real = 0.75,
augmentation_factor::Real = 2.0,
sub_kwargs = (;),
sub_objective = decorate_objective!(M, TrustRegionModelObjective(mho); sub_kwargs...),
sub_problem = DefaultManoptProblem(TangentSpace(M, p), sub_objective),
Expand All @@ -475,7 +475,33 @@ function trust_regions!(
sub_kwargs...,
),
kwargs..., #collect rest
) where {Proj, O <: Union{ManifoldHessianObjective, AbstractDecoratedManifoldObjective}, R}
) where {Proj, O <: Union{ManifoldHessianObjective, AbstractDecoratedManifoldObjective}}
R = float(
promote_type(
typeof(max_trust_region_radius),
typeof(trust_region_radius),
typeof(acceptance_rate),
typeof(ρ_regularization),
typeof(θ),
typeof(κ),
typeof(σ),
typeof(reduction_threshold),
typeof(reduction_factor),
typeof(augmentation_threshold),
typeof(augmentation_factor),
),
)
max_trust_region_radius = convert(R, max_trust_region_radius)
trust_region_radius = convert(R, trust_region_radius)
acceptance_rate = convert(R, acceptance_rate)
ρ_regularization = convert(R, ρ_regularization)
θ = convert(R, θ)
κ = convert(R, κ)
σ = convert(R, σ)
reduction_threshold = convert(R, reduction_threshold)
reduction_factor = convert(R, reduction_factor)
augmentation_threshold = convert(R, augmentation_threshold)
augmentation_factor = convert(R, augmentation_factor)
(max_trust_region_radius <= 0) && throw(
ErrorException(
"max_trust_region_radius must be positive but it is $max_trust_region_radius.",
Expand Down
9 changes: 9 additions & 0 deletions test/solvers/test_trust_regions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,13 @@ include("trust_region_model.jl")
@test f(M, q3) λ atol = 5 * 1.0e-8
@test f(M, q4) λ atol = 5 * 1.0e-10
end

@testset "Float32 support" begin
M = Euclidean(3, 3)
p = randn(Float32, 3, 3)
f(M::Euclidean, p) = sum(p .^ 2) / 2
grad(M::Euclidean, p) = p
hess(M::Euclidean, p, X) = X
trust_regions(M, f, grad, hess, p; max_trust_region_radius = 0.1f0)
end
end
Loading