Ejemplo n.º 1
0
 def _reconstruct(self, observation, out):
     observation = self.observation_space.element(observation)
     out_ = out
     if out not in self.reco_space:
         out_ = self.reco_space.zero()
     out_[:] = self.x0
     gradient = Gradient(self.op.domain)
     L = BroadcastOperator(self.op, gradient)
     f = ZeroFunctional(self.op.domain)
     l2_norm = L2NormSquared(self.op.range).translated(observation)
     l1_norm = self.lam * L1Norm(gradient.range)
     g = SeparableSum(l2_norm, l1_norm)
     op_norm = 1.1 * power_method_opnorm(L, maxiter=20)
     sigma = self.tau * op_norm**2
     admm.admm_linearized(out_,
                          f,
                          g,
                          L,
                          self.tau,
                          sigma,
                          self.niter,
                          callback=self.callback)
     if out not in self.reco_space:
         out[:] = out_
     return out
    def __call__(self, x):  # x is space time element im x vf
        ret = 0
        xim = x[0]
        xvf = x[1]
        for i in range(self.N - 1):
            ximi = xim[i]
            ximii = xim[i + 1]
            xvfi = xvf[i]
            res = self.residual(ximii, ximi, xvfi)
            ret += L1Norm(res.space)(res)

        return self.alpha * ret
Ejemplo n.º 3
0
 def _reconstruct(self, observation, out):
     observation = self.observation_space.element(observation)
     out[:] = self.x0
     gradient = Gradient(self.op.domain)
     L = BroadcastOperator(self.op, gradient)
     f = ZeroFunctional(self.op.domain)
     l2_norm = L2NormSquared(self.op.range).translated(observation)
     l1_norm = self.lam * L1Norm(gradient.range)
     g = [l2_norm, l1_norm]
     tau, sigma = douglas_rachford.douglas_rachford_pd_stepsize(L)
     douglas_rachford.douglas_rachford_pd(out,
                                          f,
                                          g,
                                          L,
                                          self.niter,
                                          tau,
                                          sigma,
                                          callback=self.callback)
     return out
Ejemplo n.º 4
0
 def _reconstruct(self, observation, out):
     observation = self.observation_space.element(observation)
     out[:] = self.x0
     gradient = Gradient(self.op.domain)
     L = BroadcastOperator(self.op, gradient)
     f = ZeroFunctional(self.op.domain)
     l2_norm = L2NormSquared(self.op.range).translated(observation)
     l1_norm = self.lam * L1Norm(gradient.range)
     g = SeparableSum(l2_norm, l1_norm)
     tau, sigma = primal_dual_hybrid_gradient.pdhg_stepsize(L)
     primal_dual_hybrid_gradient.pdhg(out,
                                      f,
                                      g,
                                      L,
                                      self.niter,
                                      tau,
                                      sigma,
                                      callback=self.callback)
     return out