src/pdps.rs

changeset 24
d29d1fcf5423
parent 13
bdc57366d4f5
equal deleted inserted replaced
23:9869fa1e0ccd 24:d29d1fcf5423
5 5
6 * Valkonen T. - _Proximal methods for point source localisation_, 6 * Valkonen T. - _Proximal methods for point source localisation_,
7 [arXiv:2212.02991](https://arxiv.org/abs/2212.02991). 7 [arXiv:2212.02991](https://arxiv.org/abs/2212.02991).
8 8
9 The main routine is [`pointsource_pdps`]. It is based on specilisatinn of 9 The main routine is [`pointsource_pdps`]. It is based on specilisatinn of
10 [`generic_pointsource_fb`] through relevant [`FBSpecialisation`] implementations. 10 [`generic_pointsource_fb_reg`] through relevant [`FBSpecialisation`] implementations.
11 Both norm-2-squared and norm-1 data terms are supported. That is, implemented are solvers for 11 Both norm-2-squared and norm-1 data terms are supported. That is, implemented are solvers for
12 <div> 12 <div>
13 $$ 13 $$
14 \min_{μ ∈ ℳ(Ω)}~ F_0(Aμ - b) + α \|μ\|_{ℳ(Ω)} + δ_{≥ 0}(μ), 14 \min_{μ ∈ ℳ(Ω)}~ F_0(Aμ - b) + α \|μ\|_{ℳ(Ω)} + δ_{≥ 0}(μ),
15 $$ 15 $$
86 PlotLookup 86 PlotLookup
87 }; 87 };
88 use crate::fb::{ 88 use crate::fb::{
89 FBGenericConfig, 89 FBGenericConfig,
90 FBSpecialisation, 90 FBSpecialisation,
91 generic_pointsource_fb 91 generic_pointsource_fb_reg,
92 }; 92 RegTerm,
93 };
94 use crate::regularisation::NonnegRadonRegTerm;
93 95
94 /// Acceleration 96 /// Acceleration
95 #[derive(Clone, Copy, Eq, PartialEq, Serialize, Deserialize, ValueEnum, Debug)] 97 #[derive(Clone, Copy, Eq, PartialEq, Serialize, Deserialize, ValueEnum, Debug)]
96 pub enum Acceleration { 98 pub enum Acceleration {
97 /// No acceleration 99 /// No acceleration
152 .for_each(|v| if *v != F::ZERO { *v = *v/<F as NumTraitsFloat>::abs(*v) }); 154 .for_each(|v| if *v != F::ZERO { *v = *v/<F as NumTraitsFloat>::abs(*v) });
153 x 155 x
154 } 156 }
155 } 157 }
156 158
157 /// Specialisation of [`generic_pointsource_fb`] to PDPS. 159 /// Specialisation of [`generic_pointsource_fb_reg`] to PDPS.
158 pub struct PDPS< 160 pub struct PDPS<
159 'a, 161 'a,
160 F : Float + ToNalgebraRealField, 162 F : Float + ToNalgebraRealField,
161 A : ForwardModel<Loc<F, N>, F>, 163 A : ForwardModel<Loc<F, N>, F>,
162 D, 164 D,
300 /// 302 ///
301 /// For the mathematical formulation, see the [module level](self) documentation and the manuscript. 303 /// For the mathematical formulation, see the [module level](self) documentation and the manuscript.
302 /// 304 ///
303 /// Returns the final iterate. 305 /// Returns the final iterate.
304 #[replace_float_literals(F::cast_from(literal))] 306 #[replace_float_literals(F::cast_from(literal))]
305 pub fn pointsource_pdps<'a, F, I, A, GA, 𝒟, BTA, G𝒟, S, K, D, const N : usize>( 307 pub fn pointsource_pdps_reg<'a, F, I, A, GA, 𝒟, BTA, G𝒟, S, K, D, Reg, const N : usize>(
306 opA : &'a A, 308 opA : &'a A,
307 b : &'a A::Observable, 309 b : &'a A::Observable,
308 α : F, 310 reg : Reg,
309 op𝒟 : &'a 𝒟, 311 op𝒟 : &'a 𝒟,
310 config : &PDPSConfig<F>, 312 config : &PDPSConfig<F>,
311 iterator : I, 313 iterator : I,
312 plotter : SeqPlotter<F, N>, 314 plotter : SeqPlotter<F, N>,
313 dataterm : D, 315 dataterm : D,
326 𝒟 : DiscreteMeasureOp<Loc<F, N>, F, PreCodomain = PreBTFN<F, G𝒟, N>>, 328 𝒟 : DiscreteMeasureOp<Loc<F, N>, F, PreCodomain = PreBTFN<F, G𝒟, N>>,
327 𝒟::Codomain : RealMapping<F, N>, 329 𝒟::Codomain : RealMapping<F, N>,
328 S: RealMapping<F, N> + LocalAnalysis<F, Bounds<F>, N>, 330 S: RealMapping<F, N> + LocalAnalysis<F, Bounds<F>, N>,
329 K: RealMapping<F, N> + LocalAnalysis<F, Bounds<F>, N>, 331 K: RealMapping<F, N> + LocalAnalysis<F, Bounds<F>, N>,
330 BTNodeLookup: BTNode<F, usize, Bounds<F>, N>, 332 BTNodeLookup: BTNode<F, usize, Bounds<F>, N>,
331 Cube<F, N>: P2Minimise<Loc<F, N>, F>,
332 PlotLookup : Plotting<N>, 333 PlotLookup : Plotting<N>,
333 DiscreteMeasure<Loc<F, N>, F> : SpikeMerging<F>, 334 DiscreteMeasure<Loc<F, N>, F> : SpikeMerging<F>,
334 PDPS<'a, F, A, D, N> : FBSpecialisation<F, A::Observable, N>, 335 PDPS<'a, F, A, D, N> : FBSpecialisation<F, A::Observable, N>,
335 D : Subdifferentiable<F, A::Observable> { 336 D : Subdifferentiable<F, A::Observable>,
337 Reg : RegTerm<F, N> {
336 338
337 let y = dataterm.some_subdifferential(-b); 339 let y = dataterm.some_subdifferential(-b);
338 let l = opA.lipschitz_factor(&op𝒟).unwrap().sqrt(); 340 let l = opA.lipschitz_factor(&op𝒟).unwrap().sqrt();
339 let τ = config.τ0 / l; 341 let τ = config.τ0 / l;
340 let σ = config.σ0 / l; 342 let σ = config.σ0 / l;
347 acceleration : config.acceleration, 349 acceleration : config.acceleration,
348 _dataterm : dataterm, 350 _dataterm : dataterm,
349 y_prev : y.clone(), 351 y_prev : y.clone(),
350 }; 352 };
351 353
352 generic_pointsource_fb( 354 generic_pointsource_fb_reg(
353 opA, α, op𝒟, τ, &config.insertion, iterator, plotter, y, 355 opA, reg, op𝒟, τ, &config.insertion, iterator, plotter, y, pdps
354 pdps
355 ) 356 )
356 } 357 }
358
359 //
360 // Deprecated interfaces
361 //
362
363 #[deprecated(note = "Use `pointsource_pdps_reg`")]
364 pub fn pointsource_pdps<'a, F, I, A, GA, 𝒟, BTA, G𝒟, S, K, D, const N : usize>(
365 opA : &'a A,
366 b : &'a A::Observable,
367 α : F,
368 op𝒟 : &'a 𝒟,
369 config : &PDPSConfig<F>,
370 iterator : I,
371 plotter : SeqPlotter<F, N>,
372 dataterm : D,
373 ) -> DiscreteMeasure<Loc<F, N>, F>
374 where F : Float + ToNalgebraRealField,
375 I : AlgIteratorFactory<IterInfo<F, N>>,
376 for<'b> &'b A::Observable : std::ops::Neg<Output=A::Observable>
377 + std::ops::Add<A::Observable, Output=A::Observable>,
378 A::Observable : std::ops::MulAssign<F>,
379 GA : SupportGenerator<F, N, SupportType = S, Id = usize> + Clone,
380 A : ForwardModel<Loc<F, N>, F, PreadjointCodomain = BTFN<F, GA, BTA, N>>
381 + Lipschitz<𝒟, FloatType=F>,
382 BTA : BTSearch<F, N, Data=usize, Agg=Bounds<F>>,
383 G𝒟 : SupportGenerator<F, N, SupportType = K, Id = usize> + Clone,
384 𝒟 : DiscreteMeasureOp<Loc<F, N>, F, PreCodomain = PreBTFN<F, G𝒟, N>>,
385 𝒟::Codomain : RealMapping<F, N>,
386 S: RealMapping<F, N> + LocalAnalysis<F, Bounds<F>, N>,
387 K: RealMapping<F, N> + LocalAnalysis<F, Bounds<F>, N>,
388 BTNodeLookup: BTNode<F, usize, Bounds<F>, N>,
389 Cube<F, N>: P2Minimise<Loc<F, N>, F>,
390 PlotLookup : Plotting<N>,
391 DiscreteMeasure<Loc<F, N>, F> : SpikeMerging<F>,
392 PDPS<'a, F, A, D, N> : FBSpecialisation<F, A::Observable, N>,
393 D : Subdifferentiable<F, A::Observable> {
394
395 pointsource_pdps_reg(opA, b, NonnegRadonRegTerm(α), op𝒟, config, iterator, plotter, dataterm)
396 }

mercurial