Esempio n. 1
0
 def proximal_numpy(self, in_arr, tau, out = None):
     res , info = regularisers.ROF_TV(in_arr,
           self.alpha,
           self.max_iteration,
           self.time_marchstep,
           self.tolerance,
           self.device)
     
     return res, info
Esempio n. 2
0
 def prox(self,x,tau):
     pars = {'algorithm' : ROF_TV, \
            'input' : np.asarray(x.as_array(), dtype=np.float32),\
             'regularization_parameter':self.lambdaReg*tau, \
             'number_of_iterations' :self.iterationsTV ,\
             'time_marching_parameter':self.time_marchstep}
     
     out = regularisers.ROF_TV(pars['input'], 
           pars['regularization_parameter'],
           pars['number_of_iterations'],
           pars['time_marching_parameter'], self.device)
     return DataContainer(out)
Esempio n. 3
0
    def proximal(self, x, tau, out=None):
        in_arr = np.asarray(x.as_array(), dtype=np.float32, order='C')
        res, info = regularisers.ROF_TV(in_arr, self.alpha, self.max_iteration,
                                        self.time_marchstep, self.tolerance,
                                        self.device)

        self.info = info

        if out is not None:
            out.fill(res)
        else:
            out = x.copy()
            out.fill(res)
        return out
Esempio n. 4
0
    def proximal(self, x, tau, out=None):
        pars = {'algorithm' : ROF_TV, \
               'input' : np.asarray(x.as_array(), dtype=np.float32),\
                'regularization_parameter':self.lambdaReg*tau, \
                'number_of_iterations' :self.iterationsTV ,\
                'time_marching_parameter':self.time_marchstep,\
                'tolerance':self.tolerance}

        res, info = regularisers.ROF_TV(pars['input'],
                                        pars['regularization_parameter'],
                                        pars['number_of_iterations'],
                                        pars['time_marching_parameter'],
                                        pars['tolerance'], self.device)

        self.info = info

        if out is not None:
            out.fill(res)
        else:
            out = x.copy()
            out.fill(res)
        return out