Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shapely Value #54

Closed
AprilDomLin opened this issue Mar 10, 2023 · 7 comments
Closed

Shapely Value #54

AprilDomLin opened this issue Mar 10, 2023 · 7 comments

Comments

@AprilDomLin
Copy link

(optional) Briefly introduce yourself.


❓ Questions and Help

似乎InterpretDL没有提供shapely value的相关计算工具和可视化功能?我没有很了解,是否有大佬能提供帮助和讯息,paddle有没有提供类似的计算方法呀?
主要shap库:https://github.com/slundberg/shap
依赖pytroch,pytroch又跟paddle不兼并。搞的我用paddle训练的模型,无法用shapely value 去做解释说明诶...

@holyseven
Copy link
Collaborator

暂时没有shapley的。shapley因为在图像方面计算量较大,最开始并没有计划实现。

模型是什么模型呢?用LIME应该都可以解释,不同的模型有不同的算法可以进行解释。

@AprilDomLin
Copy link
Author

暂时没有shapley的。shapley因为在图像方面计算量较大,最开始并没有计划实现。

模型是什么模型呢?用LIME应该都可以解释,不同的模型有不同的算法可以进行解释。

是用的ViT做的分类模型。主要想尝试做解释分析,但是最近看shapely比较多,所以想尝试一下效果。但是我看shap这个库,是可以支持shapely图像的解释欸。
哈哈哈,非常感谢,我再研究一下解释分析吧。

@holyseven
Copy link
Collaborator

holyseven commented Mar 12, 2023

vanilla ViT结构的话,可以看看这个是否有帮助:https://github.com/PaddlePaddle/InterpretDL/blob/master/examples/example_bt_ga_cv_ViT.ipynb

shapley我们这边再调研和评估一下,要是你有什么想法或者试过哪个算法感觉效果不错,也可以跟分享一下~

@AprilDomLin
Copy link
Author

shap:https://github.com/slundberg/shap。

之前有用过 这个他主要依赖于pytorch和TensorFlow的库,计算shapely value。可以用于多种机器学习的模型和深度学习模型。

btw,之前有在知乎看到过张拳石老师团队的研究,好像说可以加快在DL中shapely value 的计算。因为不是主要研究解释性的,所以没有挖掘细节。

@AprilDomLin
Copy link
Author

这个demo的两个解释方法好像存在问题。报错:AttributeError: 'NoneType' object has no attribute 'numpy'。

我看代码问题,好像是因为注册的hook在backward之前,导致block_attns里面的Tesnor就不存在梯度了。

@holyseven
Copy link
Collaborator

我这边没有问题,可以正常运行。Paddle版本:2.3.2

Paddle版本可能出现的问题查看:#51

@AprilDomLin
Copy link
Author

AprilDomLin commented Jun 25, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants