Skip to content

Commit

Permalink
BUGFIX: bracket line search would throw a pass condition when step le…
Browse files Browse the repository at this point in the history
…ngth exceeded safeguard value. This was a holdover bug from legacy seisflows and led to line searches completing even if misfit was not reduced. it would not have been encountered very often but on the chance that it was, a model would be passed that did not satisfy line search stop conditions
  • Loading branch information
bch0w committed Apr 5, 2023
1 parent c16f7e4 commit c39755f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions seisflows/plugins/line_search/bracket.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,22 +201,19 @@ def calculate_step_length(self):
alpha = None
status = "FAIL"

# Apply optional step length safeguard
if alpha is not None:
# Apply optional step length safeguard to step length
if status == "TRY":
if alpha > self.step_len_max and step_count == 0:
alpha = 0.618034 * self.step_len_max
logger.info(f"try: applying initial step length "
f"safegaurd as alpha has exceeded maximum step "
f"length, alpha_new={alpha:.2E}")
status = "TRY"
# Stop because safeguard prevents us from going further
# TODO Why is this passing? should status not be carried over?
elif alpha > self.step_len_max:
alpha = self.step_len_max
logger.info(f"try: applying initial step length "
f"safegaurd as alpha has exceeded maximum step "
f"length, alpha_new={alpha:.2E}")
status = "PASS"
logger.info(f"try: applying step length safegaurd as alpha has "
f"exceeded maximum allowable step length, "
f"alpha_new={alpha:.2E}")

return alpha, status

Expand Down

0 comments on commit c39755f

Please sign in to comment.