Quantus evaluation for Lime #265
-
Is there a better method to send parameters to Lime? I'd like to use the pre-computed explanation values (a_batch). How to set feature_mask and other Lime attributes. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @Akshatha122 Regarding setting the Lime attributes, such as explain_func_kwargs = {"xai_lib": "captum", "method": "Lime", "xai_lib_kwargs": {"feature_mask": feature_mask.to(device).long()}}
results = evaluate_xai_methods(model, ...., s_batch, nr_samples=1, explain_func_kwargs=explain_func_kwargs) Read more in our official documentation: https://quantus.readthedocs.io/en/latest/docs_api/quantus.functions.explanation_func.html#quantus.functions.explanation_func.explain LIME hyperparams: https://captum.ai/api/lime.html I hope this helps. Let me know if you have any further questions! |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response. It helped me fix the problem
…On Wed, 17 May, 2023, 3:44 am Anna Hedström, ***@***.***> wrote:
Hi @Akshatha122 <https://github.com/Akshatha122>
Regarding setting the Lime attributes, such as feature_mask, you can
extend the dictionary in the explain_func_kwargs dictionary as follows:
explain_func_kwargs = {"xai_lib": "captum", "method": "Lime", "xai_lib_kwargs": {"feature_mask": feature_mask.to(device).long()}}
results = evaluate_xai_methods(model, ...., s_batch, nr_samples=1, explain_func_kwargs=explain_func_kwargs)
Read more in our official documentation:
https://quantus.readthedocs.io/en/latest/docs_api/quantus.functions.explanation_func.html#quantus.functions.explanation_func.explain
LIME hyperparams: https://captum.ai/api/lime.html
I hope this helps. Let me know if you have any further questions!
—
Reply to this email directly, view it on GitHub
<#265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMPSWQM7S6F3BFJ3A47VHGDXGSFXBANCNFSM6AAAAAAYD5JUNU>
.
You are receiving this because you were mentioned.Message ID:
<understandable-machine-intelligence-lab/Quantus/repo-discussions/265/comments/5925053
@github.com>
|
Beta Was this translation helpful? Give feedback.
Hi @Akshatha122
Regarding setting the Lime attributes, such as
feature_mask
, you can extend the dictionary in theexplain_func_kwargs
dictionary as follows:Read more in our official documentation: https://quantus.readthedocs.io/en/latest/docs_api/quantus.functions.explanation_func.html#quantus.functions.explanation_func.explain
LIME hyperparams: https://captum.ai/api/lime.html
I hope this helps. Let me know if you have any further questions!