Skip to content

Commit 6cf9016

Browse files
Jammy2211Jammy2211
authored andcommitted
remove force edge pixels to zero
1 parent 055148f commit 6cf9016

File tree

4 files changed

+1
-14
lines changed

4 files changed

+1
-14
lines changed

autoarray/inversion/inversion/abstract.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,6 @@ def regularization_matrix(self) -> Optional[np.ndarray]:
327327
For multiple mappers, the regularization matrix is computed as the block diagonal of each individual mapper.
328328
The scipy function `block_diag` has an overhead associated with it and if there is only one mapper and
329329
regularization it is bypassed.
330-
331-
If the `settings.force_edge_pixels_to_zeros` is `True`, the edge pixels of each mapper in the inversion
332-
are regularized so high their value is forced to zero.
333330
"""
334331
if self._xp.__name__.startswith("jax"):
335332
from jax.scipy.linalg import block_diag
@@ -425,10 +422,7 @@ def reconstruction(self) -> np.ndarray:
425422
"""
426423
if self.settings.use_positive_only_solver:
427424

428-
if (
429-
self.preloads.source_pixel_zeroed_indices is not None
430-
and self.settings.force_edge_pixels_to_zeros
431-
):
425+
if self.preloads.source_pixel_zeroed_indices is not None:
432426

433427
# ids of values which are not zeroed and therefore kept in soluiton, which is computed in preloads.
434428
ids_to_keep = self.preloads.source_pixel_zeroed_indices_to_keep

autoarray/inversion/inversion/settings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def __init__(
1313
use_positive_only_solver: Optional[bool] = None,
1414
positive_only_uses_p_initial: Optional[bool] = None,
1515
use_border_relocator: Optional[bool] = None,
16-
force_edge_pixels_to_zeros: bool = True,
1716
no_regularization_add_to_curvature_diag_value: float = None,
1817
use_w_tilde_numpy: bool = False,
1918
use_source_loop: bool = False,
@@ -52,7 +51,6 @@ def __init__(
5251
self._use_positive_only_solver = use_positive_only_solver
5352
self._positive_only_uses_p_initial = positive_only_uses_p_initial
5453
self._use_border_relocator = use_border_relocator
55-
self.force_edge_pixels_to_zeros = force_edge_pixels_to_zeros
5654
self._no_regularization_add_to_curvature_diag_value = (
5755
no_regularization_add_to_curvature_diag_value
5856
)

test_autoarray/inversion/inversion/test_factory.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ def test__inversion_imaging__via_linear_obj_func_and_mapper__force_edge_pixels_t
281281
linear_obj_list=[linear_obj, delaunay_mapper_9_3x3],
282282
settings=aa.SettingsInversion(
283283
no_regularization_add_to_curvature_diag_value=False,
284-
force_edge_pixels_to_zeros=True,
285284
),
286285
)
287286

@@ -295,7 +294,6 @@ def test__inversion_imaging__via_linear_obj_func_and_mapper__force_edge_pixels_t
295294
settings=aa.SettingsInversion(
296295
use_positive_only_solver=True,
297296
no_regularization_add_to_curvature_diag_value=False,
298-
force_edge_pixels_to_zeros=True,
299297
),
300298
)
301299

@@ -362,7 +360,6 @@ def test__inversion_imaging__linear_obj_func_and_non_func_give_same_terms(
362360
linear_obj_list=[linear_obj, rectangular_mapper_7x7_3x3],
363361
settings=aa.SettingsInversion(
364362
use_positive_only_solver=True,
365-
force_edge_pixels_to_zeros=False,
366363
),
367364
)
368365

@@ -377,7 +374,6 @@ def test__inversion_imaging__linear_obj_func_and_non_func_give_same_terms(
377374
linear_obj_list=[rectangular_mapper_7x7_3x3],
378375
settings=aa.SettingsInversion(
379376
use_positive_only_solver=True,
380-
force_edge_pixels_to_zeros=False,
381377
),
382378
)
383379

test_autoarray/inversion/inversion/test_settings_dict.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def make_settings_dict():
1515
"arguments": {
1616
"use_positive_only_solver": False,
1717
"positive_only_uses_p_initial": False,
18-
"force_edge_pixels_to_zeros": True,
1918
"no_regularization_add_to_curvature_diag_value": 1e-08,
2019
"use_w_tilde_numpy": False,
2120
"use_source_loop": False,

0 commit comments

Comments
 (0)