You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw(DomainError(delta_hat, "maximum trust region radius must be positive"))
235
+
end
236
+
if!(0< initial_delta < delta_hat)
237
+
throw(DomainError(initial_delta, LazyString("initial trust region radius must be positive and below the maiximum trust region radius (", delta_hat, ")")))
238
+
end
239
+
if!(delta_min >=0)
240
+
throw(DomainError(delta_min, "smallest allowable trust region radius must be non-negative"))
241
+
end
242
+
if!(eta >=0)
243
+
throw(DomainError(eta, "minimum threshold of actual and predicted reduction for accepting a step must be positivethreshold eta must be non-negative"))
244
+
end
245
+
if!(rho_lower > eta)
246
+
throw(DomainError(rho_lower, LazyString("maximum threshold of actual and predicted reduction for shrinking the trust region must be greater than the minimum threshold for accepting a step (", eta, ")")))
247
+
end
248
+
if!(rho_upper > rho_lower)
249
+
throw(DomainError(rho_upper, LazyString("minimum threshold of actual and predicted reduction for growing the trust region must be greater than the minimum threshold for shrinking it (", rho_lower, ")")))
250
+
end
251
+
252
+
returnnew{T}(initial_delta, delta_hat, delta_min, eta, rho_lower, rho_upper, use_fg)
* `initial_delta`, the starting trust region radius. Defaults to `1.0`.
269
+
The constructor has 7 keywords:
270
+
* `initial_delta`, the initial trust region radius. Defaults to `1.0`.
240
271
* `delta_hat`, the largest allowable trust region radius. Defaults to `100.0`.
241
-
* `delta_min`, the smallest alowable trust region radius. Optimization halts if the updated radius is smaller than this value. Defaults to `sqrt(eps(Float64))`.
242
-
* `eta`, when `rho` is at least `eta`, accept the step. Defaults to `0.1`.
243
-
* `rho_lower`, when `rho` is less than `rho_lower`, shrink the trust region. Defaults to `0.25`.
244
-
* `rho_upper`, when `rho` is greater than `rho_upper`, grow the trust region. Defaults to `0.75`.
272
+
* `delta_min`, the smallest allowable trust region radius. Optimization halts if the updated radius is smaller than this value. Defaults to `sqrt(eps(Float64))`.
273
+
* `eta`, when the ratio of actual and predicted reduction is greater than `eta`, accept the step. Defaults to `0.1`.
274
+
* `rho_lower`, when the ratio of actual and predicted reduction is less than `rho_lower`, shrink the trust region. Defaults to `0.25`.
275
+
* `rho_upper`, when the ratio of actual and predicted reduction is greater than `rho_upper` and the proposed step is at the boundary of the trust region, grow the trust region. Defaults to `0.75`.
245
276
* `use_fg`, when true always evaluate the gradient with the value after solving the subproblem. This is more efficient if f and g share expensive computations. Defaults to `true`.
246
277
247
278
## Description
@@ -257,23 +288,17 @@ trust-region methods in practice.
257
288
## References
258
289
- Nocedal, J., & Wright, S. (2006). Numerical optimization. Springer Science & Business Media.
259
290
"""
260
-
NewtonTrustRegion(;
291
+
functionNewtonTrustRegion(;
261
292
initial_delta::Real=1.0,
262
293
delta_hat::Real=100.0,
263
294
delta_min::Real=sqrt(eps(Float64)),
264
295
eta::Real=0.1,
265
296
rho_lower::Real=0.25,
266
297
rho_upper::Real=0.75,
267
-
use_fg =true,
268
-
) =NewtonTrustRegion(
269
-
initial_delta,
270
-
delta_hat,
271
-
delta_min,
272
-
eta,
273
-
rho_lower,
274
-
rho_upper,
275
-
use_fg,
298
+
use_fg::Bool=true,
276
299
)
300
+
NewtonTrustRegion(promote(initial_delta, delta_hat, delta_min, eta, rho_lower, rho_upper)..., use_fg)
0 commit comments