@@ -103,14 +103,20 @@ where $\lambda = 10^{-1}$ and $A \in \mathbb{R}^{m \times n}$, with $n = 784$ re
103
103
``` julia
104
104
using LinearAlgebra, Random
105
105
using ProximalOperators
106
- using NLPModels, NLPModelsModifiers, RegularizedProblems, RegularizedOptimization, SolverCore
106
+ using NLPModels, NLPModelsModifiers, RegularizedProblems, RegularizedOptimization
107
107
using MLDatasets
108
108
109
109
random_seed = 1234
110
110
Random. seed! (random_seed)
111
111
112
- # Load the MNIST dataset
113
- model, _, _ = RegularizedProblems. svm_train_model ()
112
+ # Load MNIST from MLDatasets
113
+ imgs, labels = MLDatasets. MNIST. traindata ()
114
+
115
+ # Use RegularizedProblems' preprocessing
116
+ A, b = RegularizedProblems. generate_data (imgs, labels, (1 , 7 ), false )
117
+
118
+ # Build the models
119
+ model, _, _ = RegularizedProblems. svm_model (A, b)
114
120
115
121
# Define the Hessian approximation
116
122
f = LBFGSModel (model)
@@ -135,12 +141,12 @@ Another example is the FitzHugh-Nagumo inverse problem with an $\ell_1$ penalty,
135
141
136
142
``` julia
137
143
using LinearAlgebra
138
- using DifferentialEquations, ProximalOperators
139
- using ADNLPModels, NLPModels, NLPModelsModifiers, RegularizedOptimization, RegularizedProblems
144
+ using ProximalOperators
145
+ using NLPModels, NLPModelsModifiers, RegularizedProblems, RegularizedOptimization
146
+ using DifferentialEquations, ADNLPModels
140
147
141
- # Define the Fitzagerald Higgs problem
142
- data, _, _, _, _ = RegularizedProblems. FH_smooth_term ()
143
- fh_model = ADNLPModel (misfit, ones (5 ))
148
+ # Define the Fitzhugh-Nagumo problem
149
+ model, _, _ = RegularizedProblems. fh_model ()
144
150
145
151
# Define the Hessian approximation
146
152
f = LBFGSModel (fh_model)
0 commit comments