Esempio n. 1
0
    def __init__(self, args):
        super(MoDLRecon, self).__init__(args)
        self.l2lam = torch.nn.Parameter(torch.tensor(args.l2lam_init))

        if args.network == 'ResNet5Block':
            self.denoiser = ResNet5Block(num_filters=args.latent_channels,
                                         filter_size=7,
                                         batch_norm=args.batch_norm)
        elif args.network == 'ResNet':
            self.denoiser = ResNet(latent_channels=args.latent_channels,
                                   num_blocks=args.num_blocks,
                                   kernel_size=7,
                                   batch_norm=args.batch_norm)

        modl_recon_one_unroll = MoDLReconOneUnroll(denoiser=self.denoiser,
                                                   l2lam=self.l2lam,
                                                   args=args)
        self.unroll_model = UnrollNet(module_list=[modl_recon_one_unroll],
                                      data_list=[None],
                                      num_unrolls=self.num_unrolls)