当前正在尝试实现如下所示的shap解释程序:“https://slundberg.github.io/shap/notebooks/deep_explainer/Front%20Page%20DeepExplainer%20MNIST%20Example.html”,除了在Cifar10数据集上
我的原始图像不显示在左侧,结果是黑色方块。下面的其他图片似乎在工作
代码基本上与他们使用的相同,所以我不确定出了什么问题(可能与RGB有关?)
import shap
import numpy as np
# select a set of background examples to take an expectation over
background = x_train[np.random.choice(x_train.shape[0], 100, replace=False)]
# explain predictions of the model
e = shap.DeepExplainer(model, background)
shap_values = e.shap_values(x_test[1:5])
shap.image_plot(shap_values, -x_test[1:5])
目前没有回答
相关问题 更多 >
编程相关推荐