Skip to content

Commit

Permalink
Merge pull request #92 from SyneRBI/fix-ISTA-prior
Browse files Browse the repository at this point in the history
fix prior in ISTA example
  • Loading branch information
casperdcl authored Aug 28, 2024
2 parents e114f21 + 0c9cd2c commit fb14c87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main_ISTA.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit fb14c87

Please sign in to comment.