@@ -16,25 +16,69 @@ abstract type Solver end
16
16
17
17
# ===================== analytical.jl
18
18
19
+ """
20
+ $SIGNATURES
21
+
22
+ Analytical solver (Cholesky). If the `iterative` parameter is set to `true`
23
+ then a CG solver is used. The CG solver is matrix-free and should be preferred
24
+ in "large scale" cases (when the hat matrix `X'X` is "big").
25
+
26
+ ## Parameters
27
+
28
+ * `iterative` (Bool): whether to use CG (iterative) or not
29
+ * `max_inner` (Int): in the iterative mode, how many inner iterations to do.
30
+ """
19
31
@with_kw struct Analytical <: Solver
20
32
iterative:: Bool = false
21
33
max_inner:: Int = 200
22
34
end
23
-
24
35
CG () = Analytical (; iterative= true )
25
36
26
37
# ===================== newton.jl
27
38
39
+ """
40
+ $SIGNATURES
41
+
42
+ Newton solver. This is a full Hessian solver and should be avoided for
43
+ "large scale" cases.
44
+ """
28
45
struct Newton <: Solver end
29
46
47
+ """
48
+ $SIGNATURES
49
+
50
+ Newton CG solver. This is the same as the Newton solver except that instead
51
+ of solving systems of the form `H\\ b` where `H` is the full Hessian, it uses
52
+ a matrix-free conjugate gradient approach to solving that system. This should
53
+ generally be preferred for larger scale cases.
54
+ """
30
55
struct NewtonCG <: Solver end
31
56
57
+ """
58
+ $SIGNATURES
59
+
60
+ LBFGS quasi-Newton solver. See [the wikipedia entry](https://en.wikipedia.org/wiki/Limited-memory_BFGS).
61
+ """
32
62
struct LBFGS <: Solver end
33
63
34
64
# struct BFGS <: Solver end
35
65
36
66
# ===================== pgrad.jl
37
67
68
+ """
69
+ $SIGNATURES
70
+
71
+ Proximal Gradient solver for non-smooth objective functions.
72
+
73
+ ## Parameters
74
+
75
+ * `accel` (Bool): whether to use Nesterov-style acceleration
76
+ * `max_iter` (Int): number of overall iterations
77
+ * `tol` (Float64): tolerance for the relative change θ ie `norm(θ-θ_)/norm(θ)`
78
+ * `max_inner`: number of inner steps when searching for a stepsize in the
79
+ backtracking step
80
+ * `beta`: rate of shrinkage in the backtracking step (between 0 and 1)
81
+ """
38
82
@with_kw struct ProxGrad <: Solver
39
83
accel:: Bool = false # use Nesterov style acceleration (see also FISTA)
40
84
max_iter:: Int = 1000 # max number of overall iterations
@@ -48,6 +92,21 @@ ISTA(; kwa...) = ProxGrad(;accel = false, kwa...)
48
92
49
93
# ===================== iwls.jl
50
94
95
+ """
96
+ $SIGNATURES
97
+
98
+ Iteratively Reweighted Least Square with Conjugate Gradient. This is the
99
+ standard (expensive) IWLS but with more efficient solves to avoid full matrix
100
+ computations.
101
+
102
+ ## Parameters
103
+
104
+ * `max_iter` (Int): number of max iterations (outer)
105
+ * `max_inner` (Int): number of iterations for the CG solves
106
+ * `tol` (Float64): tolerance for the relative change θ ie `norm(θ-θ_)/norm(θ)`
107
+ * `damping` (Float64): how much to trust iterates (1=full trust)
108
+ * `threshold` (Float64): threshold for the residuals
109
+ """
51
110
@with_kw struct IWLSCG <: Solver
52
111
max_iter:: Int = 100
53
112
max_inner:: Int = 200
0 commit comments