Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with model clipping in parabolic steppers #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions occamypy/solver/stepper.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,9 @@ def run(self, problem, modl, dmodl, logger=None):
problem.bounds.apply(model_step)
if modl.isDifferent(model_step):
# Computing true scaled search direction dm = m_new_clipped - m_current
dmodl.copy(model_step)
dmodl.scaleAdd(modl, 1.0, -1.0)
modl.scaleAdd(dmodl, sc2=-self.alpha) # m_current = m_new - alpha*dmodl
dmodl.copy(modl) # m_current
dmodl.scaleAdd(model_step, -1.0, 1.0) # dm = m_new_clipped - m_current
# Scaled by the inverse of the step length
dmodl.scale(1.0 / self.alpha)
# Setting model and residual vectors to c1 or c2 point if parabola minimum is not picked
Expand Down Expand Up @@ -973,8 +974,9 @@ def run(self, problem, modl, dmodl, logger=None):
problem.bounds.apply(model_step)
if modl.isDifferent(model_step):
# Computing true scaled search direction dm = m_new_clipped - m_current
dmodl.copy(model_step)
dmodl.scaleAdd(modl, 1.0, -1.0)
modl.scaleAdd(dmodl, sc2=-self.alpha) # m_current = m_new - alpha*dmodl
dmodl.copy(modl) # m_current
dmodl.scaleAdd(model_step, -1.0, 1.0) # dm = m_new_clipped - m_current
# Scaled by the inverse of the step length
dmodl.scale(1.0 / self.alpha)
# Setting model and residual vectors to c1 or c2 point if parabola minimum is not picked
Expand Down