Skip to content

Commit

Permalink
kwarg for stepping off bounds in projected gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
lheagy committed Apr 3, 2016
1 parent 8aa23c3 commit 5d9d746
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SimPEG/Optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ def __init__(self, **kwargs):
maxIterCG = 5
tolCG = 1e-1

stepOffBoundsFact = 0.1 # perturbation of the inactive set off the bounds

lower = -np.inf
upper = np.inf

Expand Down Expand Up @@ -998,7 +1000,8 @@ def findSearchDirection(self):
dm_i = max( abs( delx ) )
dm_a = max( abs(rhs_a) )

delx = delx + rhs_a * dm_i / dm_a /10.
# perturb inactive set off of bounds so that they are included in the step
delx = delx + self.stepOffBoundsFact * (rhs_a * dm_i / dm_a)

# Only keep gradients going in the right direction on the active set
indx = ((self.xc<=self.lower) & (delx < 0)) | ((self.xc>=self.upper) & (delx > 0))
Expand Down

0 comments on commit 5d9d746

Please sign in to comment.