Commit e23497a9 authored by Matthijs's avatar Matthijs
Browse files

3d compatibility sparsity

parent c1cce5f0
...@@ -27,7 +27,7 @@ class P_Sparsity(ProxOperator): ...@@ -27,7 +27,7 @@ class P_Sparsity(ProxOperator):
else: else:
self.support = 1 self.support = 1
if self.sparsity_parameter > 30: if self.sparsity_parameter > 30 or len(config['u0'].shape) != 2:
def value_selection(original, indices, sparsity_parameter): def value_selection(original, indices, sparsity_parameter):
idx_for_threshold = unravel_index(indices[-sparsity_parameter], original.shape) idx_for_threshold = unravel_index(indices[-sparsity_parameter], original.shape)
threshold_val = abs(original[idx_for_threshold].get()) threshold_val = abs(original[idx_for_threshold].get())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment