Exemplo n.º 1
0
    LearnableInverter,
    RadialMaskFunc,
    rotate_real,
    unprep_fft_channel,
)

# ----- load configuration -----
import config  # isort:skip

# ----- global configuration -----
mpl.use("agg")
device = torch.device("cuda:0")
torch.cuda.set_device(0)

# ----- measurement configuration -----
mask_func = RadialMaskFunc(config.n, 40)
mask = unprep_fft_channel(mask_func((1, 1) + config.n + (1, )))
OpA = Fourier(mask)
inverter = LearnableInverter(config.n, mask, learnable=False)

# ----- network configuration -----
subnet_params = {
    "in_channels": 2,
    "out_channels": 2,
    "drop_factor": 0.0,
    "down_blocks": (5, 7, 9, 12, 15),
    "up_blocks": (15, 12, 9, 7, 5),
    "pool_factors": (2, 2, 2, 2, 2),
    "bottleneck_layers": 20,
    "growth_rate": 16,
    "out_chans_first_conv": 16,
    unprep_fft_channel,
)
from reconstruction_methods import admm_l1_rec_diag, grid_search

# ----- load configuration -----
import config  # isort:skip

# ------ setup ----------
device = torch.device("cuda:0")

file_name = "grid_search_l1_fourier_"
save_path = os.path.join(config.RESULTS_PATH, "grid_search_l1")

# ----- operators --------
n = (320, 320)
mask_func = RadialMaskFunc(n, 50)
mask = unprep_fft_channel(mask_func((1, 1) + n + (1, )))
OpA = Fourier(mask)
OpTV = TVAnalysisPeriodic(n, device=device)

# ----- load test data --------
test_data_params = {
    "mask_func":
    mask_func,
    "seed":
    1,
    "filter": [filter_acquisition_no_fs],
    "num_sym_slices":
    0,
    "multi_slice_gt":
    False,
Exemplo n.º 3
0
        CropOrPadAndResimulate((320, 320)),
        Flatten(0, -3),
        Normalize(reduction="mean", use_target=True),
    ], ),
    "train_loader_params": {
        "shuffle": True,
        "num_workers": 8
    },
    "val_loader_params": {
        "shuffle": False,
        "num_workers": 8
    },
}

# ----- data configuration -----
mask_func = RadialMaskFunc((320, 320), 50)

train_data_params = {
    "mask_func": mask_func,
    "seed": 1,
    "filter": [filter_acquisition_no_fs],
    "num_sym_slices": 0,
    "multi_slice_gt": False,
    "keep_mask_as_func": True,
}
train_data = AlmostFixedMaskDataset

val_data_params = {
    "mask_func": mask_func,
    "seed": 1,
    "filter": [filter_acquisition_no_fs],