src/prox_penalty.rs

branch
dev
changeset 63
7a8a55fd41c0
parent 61
4f468d35fa29
equal deleted inserted replaced
61:4f468d35fa29 63:7a8a55fd41c0
127 /// with the forward step term fixed to `τv`. 127 /// with the forward step term fixed to `τv`.
128 /// 128 ///
129 /// May return `τv + w` for `w` a subdifferential of the regularisation term `reg`, 129 /// May return `τv + w` for `w` a subdifferential of the regularisation term `reg`,
130 /// as well as an indication of whether the tolerance bounds `ε` are satisfied. 130 /// as well as an indication of whether the tolerance bounds `ε` are satisfied.
131 /// 131 ///
132 /// `μ_base + ν_delta` is the base point, where `μ` and `μ_base` are assumed to have the same
133 /// spike locations, while `ν_delta` may have different locations.
134 ///
135 /// `τv` is mutable to allow [`alg_tools::bounds::MinMaxMapping`] optimisation to 132 /// `τv` is mutable to allow [`alg_tools::bounds::MinMaxMapping`] optimisation to
136 /// refine data. Actual values of `τv` are not supposed to be mutated. 133 /// refine data. Actual values of `τv` are not supposed to be mutated.
134 ///
135 /// `stats.inserted` should not be updated by implementations of this routine,
136 /// only `stats.inner_iters`.
137 fn insert_and_reweigh<I>( 137 fn insert_and_reweigh<I>(
138 &self, 138 &self,
139 μ: &mut DiscreteMeasure<Domain, F>, 139 μ: &mut DiscreteMeasure<Domain, F>,
140 τv: &mut PreadjointCodomain, 140 τv: &mut PreadjointCodomain,
141 μ_base: &DiscreteMeasure<Domain, F>,
142 ν_delta: Option<&DiscreteMeasure<Domain, F>>,
143 τ: F, 141 τ: F,
144 ε: F, 142 ε: F,
145 config: &InsertionConfig<F>, 143 config: &InsertionConfig<F>,
146 reg: &Reg, 144 reg: &Reg,
147 state: &AlgIteratorIteration<I>, 145 state: &AlgIteratorIteration<I>,
158 fn merge_spikes( 156 fn merge_spikes(
159 &self, 157 &self,
160 μ: &mut DiscreteMeasure<Domain, F>, 158 μ: &mut DiscreteMeasure<Domain, F>,
161 τv: &mut PreadjointCodomain, 159 τv: &mut PreadjointCodomain,
162 μ_base: &DiscreteMeasure<Domain, F>, 160 μ_base: &DiscreteMeasure<Domain, F>,
163 ν_delta: Option<&DiscreteMeasure<Domain, F>>,
164 τ: F, 161 τ: F,
165 ε: F, 162 ε: F,
166 config: &InsertionConfig<F>, 163 config: &InsertionConfig<F>,
167 reg: &Reg, 164 reg: &Reg,
168 fitness: Option<impl Fn(&DiscreteMeasure<Domain, F>) -> F>, 165 fitness: Option<impl Fn(&DiscreteMeasure<Domain, F>) -> F>,
175 fn merge_spikes_no_fitness( 172 fn merge_spikes_no_fitness(
176 &self, 173 &self,
177 μ: &mut DiscreteMeasure<Domain, F>, 174 μ: &mut DiscreteMeasure<Domain, F>,
178 τv: &mut PreadjointCodomain, 175 τv: &mut PreadjointCodomain,
179 μ_base: &DiscreteMeasure<Domain, F>, 176 μ_base: &DiscreteMeasure<Domain, F>,
180 ν_delta: Option<&DiscreteMeasure<Domain, F>>,
181 τ: F, 177 τ: F,
182 ε: F, 178 ε: F,
183 config: &InsertionConfig<F>, 179 config: &InsertionConfig<F>,
184 reg: &Reg, 180 reg: &Reg,
185 ) -> usize { 181 ) -> usize {
191 } 187 }
192 self.merge_spikes( 188 self.merge_spikes(
193 μ, 189 μ,
194 τv, 190 τv,
195 μ_base, 191 μ_base,
196 ν_delta,
197 τ, 192 τ,
198 ε, 193 ε,
199 config, 194 config,
200 reg, 195 reg,
201 into_none(Some(|_: &DiscreteMeasure<Domain, F>| F::ZERO)), 196 into_none(Some(|_: &DiscreteMeasure<Domain, F>| F::ZERO)),

mercurial