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

BUG: Warning: unrecognized nn.Module: Chomp1d #3618

Open
3 of 4 tasks
xiaonig opened this issue Apr 19, 2024 · 2 comments
Open
3 of 4 tasks

BUG: Warning: unrecognized nn.Module: Chomp1d #3618

xiaonig opened this issue Apr 19, 2024 · 2 comments
Labels
awaiting feedback Indicates that further information is required from the issue creator

Comments

@xiaonig
Copy link

xiaonig commented Apr 19, 2024

Issue Description

Hello I am using SHAP for TCN model interpretation and I found that the following prompt always appears, I am checking the documentation and it says that the layer is not supported in SHAP, is there a solution for this?Looking forward to hearing from you!
image

Minimal Reproducible Example

实现TCN模型SHAP解释
model = TCN(
    input_size, output_size,  num_channels,kernel_size=3, dropout=dropout_rate
    )
model.load_state_dict(torch.load(PATH)
计算训练时的输入SHAP值
train_seq_concat = torch.cat((train_pp, train_con), dim=-1).cpu()
train_background = train_seq_concat[np.random.choice(train_seq_concat.shape[0], 100, replace=False)]
train_explainer = shap.DeepExplainer(model,train_background)
train_shap_values= train_explainer.shap_values(train_seq_concat)
train_shap_values_path=os.path.join(pwd, "xiaoning", "data","result","shp","tcn","1","npy","train_lstm_shap_values.npy")
train_shap_values_npy=np.save(train_shap_values_path,train_shap_values)

Traceback

No response

Expected Behavior

No response

Bug report checklist

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest release of shap.
  • I have confirmed this bug exists on the master branch of shap.
  • I'd be interested in making a PR to fix this bug

Installed Versions

image

@xiaonig xiaonig added the bug Indicates an unexpected problem or unintended behaviour label Apr 19, 2024
@xiaonig
Copy link
Author

xiaonig commented Apr 19, 2024

I'm using the DeepExplainer method from shap explanatory

@CloseChoice
Copy link
Collaborator

Could you please provide a reproducible example so that we can add a test for this once it is fixed?

@CloseChoice CloseChoice added awaiting feedback Indicates that further information is required from the issue creator and removed bug Indicates an unexpected problem or unintended behaviour labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Indicates that further information is required from the issue creator
Projects
None yet
Development

No branches or pull requests

2 participants