src/pdps.rs

changeset 77
be105c046777
parent 75
677a5fd1b014
child 78
2a122736e91c
equal deleted inserted replaced
75:677a5fd1b014 77:be105c046777
107 /// Dual step length scaling. We must have `τ0 * σ0 < 1`. 107 /// Dual step length scaling. We must have `τ0 * σ0 < 1`.
108 pub σ0: F, 108 pub σ0: F,
109 /// Accelerate if available 109 /// Accelerate if available
110 pub acceleration: Acceleration, 110 pub acceleration: Acceleration,
111 /// Generic parameters 111 /// Generic parameters
112 pub generic: InsertionConfig<F>, 112 pub insertion: InsertionConfig<F>,
113 } 113 }
114 114
115 #[replace_float_literals(F::cast_from(literal))] 115 #[replace_float_literals(F::cast_from(literal))]
116 impl<F: Float> Default for PDPSConfig<F> { 116 impl<F: Float> Default for PDPSConfig<F> {
117 fn default() -> Self { 117 fn default() -> Self {
118 let τ0 = 5.0; 118 let τ0 = 5.0;
119 PDPSConfig { 119 PDPSConfig {
120 τ0, 120 τ0,
121 σ0: 0.99 / τ0, 121 σ0: 0.99 / τ0,
122 acceleration: Acceleration::Partial, 122 acceleration: Acceleration::Partial,
123 generic: InsertionConfig { 123 insertion: InsertionConfig {
124 merging: SpikeMergingMethod { enabled: true, ..Default::default() }, 124 merging: SpikeMergingMethod { enabled: true, ..Default::default() },
125 ..Default::default() 125 ..Default::default()
126 }, 126 },
127 } 127 }
128 } 128 }
171 let opA = f.operator(); 171 let opA = f.operator();
172 let b = f.data(); 172 let b = f.data();
173 let phistar = f.fidelity().conjugate(); 173 let phistar = f.fidelity().conjugate();
174 174
175 // Set up parameters 175 // Set up parameters
176 let config = &pdpsconfig.generic; 176 let config = &pdpsconfig.insertion;
177 let l = prox_penalty.step_length_bound_pd(opA)?; 177 let l = prox_penalty.step_length_bound_pd(opA)?;
178 let mut τ = pdpsconfig.τ0 / l; 178 let mut τ = pdpsconfig.τ0 / l;
179 let mut σ = pdpsconfig.σ0 / l; 179 let mut σ = pdpsconfig.σ0 / l;
180 let γ = phistar.factor_of_strong_convexity(); 180 let γ = phistar.factor_of_strong_convexity();
181 181

mercurial