From 0c9cd2cb3bc8ca18b2e28852c43eb8f69bdcf021 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Wed, 28 Aug 2024 16:22:25 +0100 Subject: [PATCH] fix prior --- main_ISTA.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main_ISTA.py b/main_ISTA.py index 3afe121..021dff1 100644 --- a/main_ISTA.py +++ b/main_ISTA.py @@ -58,7 +58,10 @@ def __init__(self, data: Dataset, num_subsets: int = 7, step_size: float = 0.1, data_sub, acq_models, obj_funs = partitioner.data_partition(data.acquired_data, data.additive_term, data.mult_factors, num_subsets, mode='staggered', initial_image=data.OSEM_image) - for f in obj_funs: # add prior to every objective function + # WARNING: modifies prior strength with 1/num_subsets (as currently needed for ISTA implementations) + data.prior.set_penalisation_factor(data.prior.get_penalisation_factor() / len(obj_funs)) + data.prior.set_up(data.OSEM_image) + for f in obj_funs: # add prior evenly to every objective function f.set_prior(data.prior) sampler = Sampler.random_without_replacement(len(obj_funs))