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

Code for experiments in the paper #7

Open
xqyzjl opened this issue Oct 16, 2024 · 1 comment
Open

Code for experiments in the paper #7

xqyzjl opened this issue Oct 16, 2024 · 1 comment

Comments

@xqyzjl
Copy link

xqyzjl commented Oct 16, 2024

I've carefully read your paper and tried craft on my own data. It's a wonderful work!

But I have some questions of the code:

  1. The tutorial in the codebase use the NMF in scikit-learn, which is not the one you implemented in the supplementary material.
  2. The recursive discovery of concepts is not implemented in this codebase.
  3. The heatmap visualization of the input image is not implemented as the supplementary material. Instead, just resize the activation feature.
  4. There's a very beautiful visualization of concepts in the paper which is cited using methods in "https://distill.pub/2017/feature-visualization" but no code for this.

I really want to follow your work and do some further explorations. I would appreciate it if you could provide me with the above code!

@expectopatronum
Copy link

I will add to this issue, since my question is also related to the code, I hope you don't mind @xqyzjl! :)
I have a question regarding the global average pooling mentioned in Section 3.1, as it is not clear to me which dimensions should be pooled. I would have expected A (n x h x w x c) to be pooled to (n x c) where (n ... samples, h ... height, w ... width, c ... channels).

This is the corresponding source code:

        # if the activations have shape (n_samples, height, width, n_channels),
        # apply average pooling
        if len(activations.shape) == 4:
            activations = torch.mean(activations, dim=(2, 3))

If I understand that correctly (and I tried it to make sure), this reduces the activations to n x h, since width and n_channels are the 2nd and 3rd dimensions. Could you please help me understand where I am wrong? :)

Best regards
Verena

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