Update reference model parameter.

This commit is contained in:
rowanc1
2014-04-14 09:30:18 -07:00
parent 1bf18ee12f
commit dbd1334e0b
2 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ class BaseObjFunction(object):
if self.debug: print 'Calling ObjFunction.startup'
if self.reg.mref is None:
print 'Regularization has not set mref. SimPEG will set it to m0.'
print 'Regularization has not set mref. SimPEG.ObjFunction will set it to m0.'
self.reg.mref = m0
self.phi_d = np.nan
+14 -1
View File
@@ -56,7 +56,7 @@ class Parameter(object):
if (self.current is None or
not self.opt.iter == self.currentIter):
self.current = self.nextIter()
self.currentIter = self.opt.iter
self.currentIter = getattr(self.opt, 'iter', 0)
return self.current
def nextIter(self):
@@ -162,3 +162,16 @@ class BetaSchedule(BetaEstimate):
self.beta /= self.coolingFactor
return self.beta
class UpdateReferenceModel(Parameter):
mref0 = None
def nextIter(self):
mref = getattr(self, 'm_prev', None)
if mref is None:
if self.debug: print 'UpdateReferenceModel is using mref0'
mref = self.mref0
self.m_prev = self.objFunc.m_current
return mref