model.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:hippylib 作者: hippylib 项目源码 文件源码
def evalGradientParameter(self,x, mg):
        """
        Evaluate the gradient for the variational parameter equation at the point x=[u,a,p].
        Parameters:
        - x = [u,a,p] the point at which to evaluate the gradient.
        - mg the variational gradient (g, atest) being atest a test function in the parameter space
          (Output parameter)

        Returns the norm of the gradient in the correct inner product g_norm = sqrt(g,g)
        """ 
        self.prior.grad(x[PARAMETER], mg)
        tmp = self.generate_vector(PARAMETER)
        self.problem.eval_da(x, tmp)
        mg.axpy(1., tmp)
        self.misfit.grad(PARAMETER,x,tmp)
        mg.axpy(1., tmp)
        self.prior.Msolver.solve(tmp, mg)
        #self.prior.Rsolver.solve(tmp, mg)
        return math.sqrt(mg.inner(tmp))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号