@@ -673,23 +673,20 @@ def train_model_xai(config: dict, fun_control: dict, timestamp: bool = True) ->
673673 attribution_ig = attr_ig .attribute (X_val_tensor , baselines = baseline )
674674 ig_attr_test_sum = attribution_ig .detach ().numpy ().sum (0 )
675675 ig_attr_test_norm_sum = ig_attr_test_sum / np .linalg .norm (ig_attr_test_sum , ord = 1 )
676- print ("Integrated Gradients attribution sum:" , ig_attr_test_norm_sum )
677676 attributions_dict ["IntegratedGradients" ] = ig_attr_test_norm_sum
678677
679678 if "KernelShap" in fun_control ["xai_methods" ]:
680679 attr_ks = KernelShap (model )
681680 attribution_ks = attr_ks .attribute (X_val_tensor , baselines = baseline )
682681 ks_attr_test_sum = attribution_ks .detach ().numpy ().sum (0 )
683682 ks_attr_test_norm_sum = ks_attr_test_sum / np .linalg .norm (ks_attr_test_sum , ord = 1 )
684- print ("KernelShap attribution sum:" , ks_attr_test_norm_sum )
685683 attributions_dict ["KernelShap" ] = ks_attr_test_norm_sum
686684
687685 if "DeepLift" in fun_control ["xai_methods" ]:
688686 attr_dl = DeepLift (model )
689687 attribution_dl = attr_dl .attribute (X_val_tensor , baselines = baseline )
690688 dl_attr_test_sum = attribution_dl .detach ().numpy ().sum (0 )
691689 dl_attr_test_norm_sum = dl_attr_test_sum / np .linalg .norm (dl_attr_test_sum , ord = 1 )
692- print ("DeepLift attribution sum:" , dl_attr_test_norm_sum )
693690 attributions_dict ["DeepLift" ] = dl_attr_test_norm_sum
694691
695692 attributions_list = [attributions_dict [method ] for method in fun_control ["xai_methods" ]]
0 commit comments