From e0b51720dc16cd4fcaf6d2093970999d4283be10 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Barbarant Date: Thu, 14 Dec 2023 20:21:09 +0100 Subject: [PATCH 1/2] Invert id_reg list --- examples/01_brain_alignment/plot_2_aligning_brain_sparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/01_brain_alignment/plot_2_aligning_brain_sparse.py b/examples/01_brain_alignment/plot_2_aligning_brain_sparse.py index f7d259a..c18b929 100644 --- a/examples/01_brain_alignment/plot_2_aligning_brain_sparse.py +++ b/examples/01_brain_alignment/plot_2_aligning_brain_sparse.py @@ -694,7 +694,7 @@ def plot_surface_map( # plus ``(1 - id_reg)`` times the transport plan computed by FUGW. # Set of weights for the regularization parameter -id_reg = [.0, .5, 1.] +id_reg = [1.0, 0.5, 0.0] fig = plt.figure(figsize=(3 * 5, 4)) fig.suptitle( From 54dff4d3f8e226ff28c90732aa6e2f1ee4251a0c Mon Sep 17 00:00:00 2001 From: Pierre-Louis Barbarant Date: Fri, 29 Dec 2023 03:18:35 +0100 Subject: [PATCH 2/2] Use enumerate for more robust behavior --- .../01_brain_alignment/plot_2_aligning_brain_sparse.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/01_brain_alignment/plot_2_aligning_brain_sparse.py b/examples/01_brain_alignment/plot_2_aligning_brain_sparse.py index c18b929..5a8b425 100644 --- a/examples/01_brain_alignment/plot_2_aligning_brain_sparse.py +++ b/examples/01_brain_alignment/plot_2_aligning_brain_sparse.py @@ -694,7 +694,7 @@ def plot_surface_map( # plus ``(1 - id_reg)`` times the transport plan computed by FUGW. # Set of weights for the regularization parameter -id_reg = [1.0, 0.5, 0.0] +id_reg = [0.0, 0.5, 1.0] fig = plt.figure(figsize=(3 * 5, 4)) fig.suptitle( @@ -713,13 +713,13 @@ def plot_surface_map( colorbar=False, ) -for i in range(len(id_reg)): +for i, weight in enumerate(sorted(id_reg, reverse=True)): predicted_target_features = fine_mapping.transform( source_features[contrast_index, :], - id_reg=id_reg[i], + id_reg=weight, ) ax = fig.add_subplot(grid_spec[0, i + 1], projection="3d") - ax.set_title(f"id_reg={id_reg[i]}") + ax.set_title(f"id_reg={weight}") plot_surface_map( predicted_target_features, axes=ax, vmax=10, vmin=-10, colorbar=False )