kwarg for stepping off bounds in projected gradient

This commit is contained in:
Lindsey Heagy
2016-04-03 10:42:28 -07:00
parent 8aa23c31de
commit 5d9d746932
+4 -1
View File
@@ -888,6 +888,8 @@ class ProjectedGNCG(BFGS, Minimize, Remember):
maxIterCG = 5
tolCG = 1e-1
stepOffBoundsFact = 0.1 # perturbation of the inactive set off the bounds
lower = -np.inf
upper = np.inf
@@ -998,7 +1000,8 @@ class ProjectedGNCG(BFGS, Minimize, Remember):
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))