/[escript]/trunk/downunder/py_src/inversioncostfunctions.py
ViewVC logotype

Diff of /trunk/downunder/py_src/inversioncostfunctions.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4076 by gross, Thu Nov 15 03:45:24 2012 UTC revision 4079 by gross, Fri Nov 16 07:59:01 2012 UTC
# Line 98  class SimpleInversionCostFunction(Metere Line 98  class SimpleInversionCostFunction(Metere
98          # only one of each...          # only one of each...
99          if len(args)==0:          if len(args)==0:
100              args=self.getArguments(m)              args=self.getArguments(m)
101    
102          return  self.mu_model * self.forwardmodel.getValue(args[0],*args[1]) \          return  self.mu_model * self.forwardmodel.getValue(args[0],*args[1]) \
103                 +  self.regularization.getValue(m, *args[2])                 +  self.regularization.getValue(m, *args[2])
104    
# Line 114  class SimpleInversionCostFunction(Metere Line 115  class SimpleInversionCostFunction(Metere
115    
116          Y = self.forwardmodel.getGradient(args[0],*args[1]) * dpdm          Y = self.forwardmodel.getGradient(args[0],*args[1]) * dpdm
117          g_reg = self.regularization.getGradient(m, *args[2])          g_reg = self.regularization.getGradient(m, *args[2])
118            print "grad forward = ", Y
119            print "grad regularization Y  = ", g_reg[0]
120            print "grad regularization X = ", g_reg[1]
121                    
122            
123          return self.mu_model * ArithmeticTuple(Y, Data()) + g_reg          return self.mu_model * ArithmeticTuple(Y, Data()) + g_reg
124    
125    
# Line 132  class SimpleInversionCostFunction(Metere Line 137  class SimpleInversionCostFunction(Metere
137          :note: in the current implementation only the regularization term is considered in the          :note: in the current implementation only the regularization term is considered in the
138          inverse Hessian approximation.          inverse Hessian approximation.
139          """          """
140          return self.regularization.getInverseHessianApproximation(m, r, *args[2])          print "nverseHessianApproximation:"
141            print "Y  = ",r[0]
142            print "X  = ",r[1]
143            m=self.regularization.getInverseHessianApproximation(m, r, *args[2])
144            print "m  = ",m
145            return m
146                    
147      def updateHessian(self):      def updateHessian(self):
148          """          """

Legend:
Removed from v.4076  
changed lines
  Added in v.4079

  ViewVC Help
Powered by ViewVC 1.1.26