|
4861 | 4861 | },
|
4862 | 4862 | {
|
4863 | 4863 | "cell_type": "code",
|
4864 |
| - "execution_count": 20, |
| 4864 | + "execution_count": 21, |
4865 | 4865 | "metadata": {},
|
4866 | 4866 | "outputs": [
|
4867 | 4867 | {
|
4868 |
| - "ename": "NameError", |
4869 |
| - "evalue": "name 'se' is not defined", |
4870 |
| - "output_type": "error", |
4871 |
| - "traceback": [ |
4872 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
4873 |
| - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", |
4874 |
| - "\u001b[0;32m<ipython-input-20-8a2f83a951d2>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mdel\u001b[0m \u001b[0mse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", |
4875 |
| - "\u001b[0;31mNameError\u001b[0m: name 'se' is not defined" |
| 4868 | + "name": "stdout", |
| 4869 | + "output_type": "stream", |
| 4870 | + "text": [ |
| 4871 | + "WARNING:tensorflow:From /home/ambreesh/Documents/amb_venv/lib/python3.6/site-packages/shap/explainers/tf_utils.py:28: The name tf.keras.backend.get_session is deprecated. Please use tf.compat.v1.keras.backend.get_session instead.\n", |
| 4872 | + "\n" |
| 4873 | + ] |
| 4874 | + }, |
| 4875 | + { |
| 4876 | + "name": "stderr", |
| 4877 | + "output_type": "stream", |
| 4878 | + "text": [ |
| 4879 | + "keras is no longer supported, please use tf.keras instead.\n", |
| 4880 | + "WARNING:tensorflow:From /home/ambreesh/Documents/amb_venv/lib/python3.6/site-packages/shap/explainers/tf_utils.py:28: The name tf.keras.backend.get_session is deprecated. Please use tf.compat.v1.keras.backend.get_session instead.\n", |
| 4881 | + "\n" |
4876 | 4882 | ]
|
4877 | 4883 | }
|
4878 | 4884 | ],
|
4879 |
| - "source": [ |
4880 |
| - "del se" |
4881 |
| - ] |
4882 |
| - }, |
4883 |
| - { |
4884 |
| - "cell_type": "code", |
4885 |
| - "execution_count": null, |
4886 |
| - "metadata": {}, |
4887 |
| - "outputs": [], |
4888 | 4885 | "source": [
|
4889 | 4886 | "se = SHAP_Explainer(blend_alpha=0.45)\n",
|
4890 | 4887 | "shap_out = se.explain(model, X_train[:1000], X_test/255.)\n",
|
|
4907 | 4904 | },
|
4908 | 4905 | {
|
4909 | 4906 | "cell_type": "code",
|
4910 |
| - "execution_count": null, |
| 4907 | + "execution_count": 22, |
4911 | 4908 | "metadata": {},
|
4912 |
| - "outputs": [], |
| 4909 | + "outputs": [ |
| 4910 | + { |
| 4911 | + "name": "stdout", |
| 4912 | + "output_type": "stream", |
| 4913 | + "text": [ |
| 4914 | + "dict_keys(['Gradient_Inputs', 'Saliency', 'Integrated_Gradients', 'e-LRP', 'Occlusion', 'LIME', 'SHAP'])\n" |
| 4915 | + ] |
| 4916 | + }, |
| 4917 | + { |
| 4918 | + "data": { |
| 4919 | + "text/plain": [ |
| 4920 | + "True" |
| 4921 | + ] |
| 4922 | + }, |
| 4923 | + "execution_count": 22, |
| 4924 | + "metadata": {}, |
| 4925 | + "output_type": "execute_result" |
| 4926 | + } |
| 4927 | + ], |
4913 | 4928 | "source": [
|
4914 | 4929 | "print(xai_results.keys())\n",
|
4915 | 4930 | "dump_pickle(xai_results, \"results/xai_results_%s.pkl\"%(DATASET))"
|
4916 | 4931 | ]
|
4917 | 4932 | },
|
4918 | 4933 | {
|
4919 | 4934 | "cell_type": "code",
|
4920 |
| - "execution_count": null, |
| 4935 | + "execution_count": 23, |
4921 | 4936 | "metadata": {},
|
4922 | 4937 | "outputs": [],
|
4923 | 4938 | "source": [
|
|
0 commit comments