Skip to content

Commit

Permalink
add explainer in config
Browse files Browse the repository at this point in the history
  • Loading branch information
OuyangWenyu committed Oct 28, 2023
1 parent 18c66aa commit 69db841
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions torchhydro/configs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def default_config_file():
"metrics": ["NSE"],
"fill_nan": "no",
"test_epoch": 20,
"explainer": None,
},
}

Expand Down
4 changes: 2 additions & 2 deletions torchhydro/trainers/deep_hydro.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Author: Wenyu Ouyang
Date: 2021-12-31 11:08:29
LastEditTime: 2023-10-28 11:08:37
LastEditTime: 2023-10-28 13:22:06
LastEditors: Wenyu Ouyang
Description: HydroDL model class
FilePath: \torchhydro\torchhydro\trainers\deep_hydro.py
Expand Down Expand Up @@ -361,7 +361,7 @@ def model_evaluate(self) -> Tuple[Dict, np.array, np.array]:
]

# Finally, try to explain model behaviour using shap
is_shap = True
is_shap = self.cfgs["evaluation_cfgs"]["explainer"] == "shap"
if is_shap:
deep_explain_model_summary_plot(self.model, test_data)
deep_explain_model_heatmap(self.model, test_data)
Expand Down

0 comments on commit 69db841

Please sign in to comment.