Skip to content

Commit f6e8edc

Browse files
jcapriotdomfournier
authored andcommitted
Fix beta cooling in IRLS
(cherry picked from commit 16c8b36)
1 parent fe35538 commit f6e8edc

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

simpeg/directives/_regularization.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,19 +229,20 @@ def adjust_cooling_schedule(self):
229229
"""
230230
Adjust the cooling schedule based on the misfit.
231231
"""
232-
ratio = self.invProb.phi_d / self.misfit_from_chi_factor(self.chifact_target)
232+
if self.metrics.start_irls_iter is not None:
233+
ratio = self.invProb.phi_d / self.misfit_from_chi_factor(
234+
self.chifact_target
235+
)
236+
if np.abs(1.0 - ratio) > self.misfit_tolerance:
233237

234-
if (
235-
np.abs(1.0 - ratio) > self.misfit_tolerance
236-
and self.metrics.start_irls_iter is not None
237-
):
238+
if ratio > 1:
239+
update_ratio = 1 / np.mean([0.75, 1 / ratio])
240+
else:
241+
update_ratio = 1 / np.mean([2.0, 1 / ratio])
238242

239-
if ratio > 1:
240-
ratio = np.mean([2.0, ratio])
243+
self.cooling_factor = update_ratio
241244
else:
242-
ratio = np.mean([0.75, ratio])
243-
244-
self.cooling_factor = ratio
245+
self.cooling_factor = 1.0
245246

246247
def initialize(self):
247248
"""

0 commit comments

Comments
 (0)