src/forward_pdps.rs

branch
dev
changeset 63
7a8a55fd41c0
parent 61
4f468d35fa29
child 65
ec5f160c413b
equal deleted inserted replaced
61:4f468d35fa29 63:7a8a55fd41c0
134 H: Conjugable<Y, F, Codomain = F>, 134 H: Conjugable<Y, F, Codomain = F>,
135 for<'b> H::Conjugate<'b>: Prox<Y>, 135 for<'b> H::Conjugate<'b>: Prox<Y>,
136 Plot: Plotter<P::ReturnMapping, S, RNDM<N, F>>, 136 Plot: Plotter<P::ReturnMapping, S, RNDM<N, F>>,
137 { 137 {
138 // Check parameters 138 // Check parameters
139 // ensure!( 139 ensure!(
140 // config.τ0 > 0.0 140 config.τ0 > 0.0
141 // && config.τ0 < 1.0 141 && config.τ0 < 1.0
142 // && config.σp0 > 0.0 142 && config.σp0 > 0.0
143 // && config.σp0 < 1.0 143 && config.σp0 < 1.0
144 // && config.σd0 >= 0.0 144 && config.σd0 >= 0.0
145 // && config.σp0 * config.σd0 <= 1.0, 145 && config.σp0 * config.σd0 <= 1.0,
146 // "Invalid step length parameters" 146 "Invalid step length parameters"
147 // ); 147 );
148 148
149 // Initialise iterates 149 // Initialise iterates
150 let mut μ = μ0.unwrap_or_else(|| DiscreteMeasure::new()); 150 let mut μ = μ0.unwrap_or_else(|| DiscreteMeasure::new());
151 151
152 // Set up parameters 152 // Set up parameters
204 204
205 // Construct μ^{k+1} by solving finite-dimensional subproblems and insert new spikes. 205 // Construct μ^{k+1} by solving finite-dimensional subproblems and insert new spikes.
206 let (maybe_d, _within_tolerances) = prox_penalty.insert_and_reweigh( 206 let (maybe_d, _within_tolerances) = prox_penalty.insert_and_reweigh(
207 &mut μ, 207 &mut μ,
208 &mut τv, 208 &mut τv,
209 &μ_base,
210 None,
211 τ, 209 τ,
212 ε, 210 ε,
213 &config.insertion, 211 &config.insertion,
214 &reg, 212 &reg,
215 &state, 213 &state,
216 &mut stats, 214 &mut stats,
217 )?; 215 )?;
216
217 stats.inserted += μ.len() - μ_base.len();
218 218
219 // Merge spikes. 219 // Merge spikes.
220 // This crucially expects the merge routine to be stable with respect to spike locations, 220 // This crucially expects the merge routine to be stable with respect to spike locations,
221 // and not to performing any pruning. That is be to done below simultaneously for γ. 221 // and not to performing any pruning. That is be to done below simultaneously for γ.
222 // Merge spikes. 222 // Merge spikes.
223 // This crucially expects the merge routine to be stable with respect to spike locations, 223 // This crucially expects the merge routine to be stable with respect to spike locations,
224 // and not to performing any pruning. That is be to done below simultaneously for γ. 224 // and not to performing any pruning. That is be to done below simultaneously for γ.
225 let ins = &config.insertion; 225 let ins = &config.insertion;
226 if ins.merge_now(&state) { 226 if ins.merge_now(&state) {
227 stats.merged += prox_penalty.merge_spikes_no_fitness( 227 stats.merged +=
228 &mut μ, &mut τv, &μ_base, None, τ, ε, ins, 228 prox_penalty.merge_spikes_no_fitness(&mut μ, &mut τv, &μ_base, τ, ε, ins, &reg);
229 &reg,
230 //Some(|μ̃ : &RNDM<N, F>| calculate_residual(Pair(μ̃, &z), opA, b).norm2_squared_div2()),
231 );
232 } 229 }
233 230
234 // Prune spikes with zero weight. 231 // Prune spikes with zero weight.
235 stats.pruned += prune_with_stats(&mut μ); 232 stats.pruned += prune_with_stats(&mut μ);
236 233

mercurial