Skip to content

Conversation

ProGamerGov
Copy link
Contributor

@ProGamerGov ProGamerGov commented Jan 27, 2022

This PR simplifies the commit history of: #730

This PR adds the ClassActivationAtlas_OptimViz.ipynb tutorial notebook, which is the final activation atlas tutorial. I've also updated the class atlas notebook based on the feedback for the main atlas tutorial.

@NarineK
Copy link
Contributor

NarineK commented Mar 29, 2022

@ProGamerGov, sorry for getting back late to this PR. I've just had a quick look and it looks like some of the things that we showcase here we already have in the tutorial that we've already merged:
https://github.com/pytorch/captum/blob/optim-wip/tutorials/optimviz/atlas/ActivationAtlas_OptimViz.ipynb

For example Activation Atlas Shape and Dimensionality Reduction For Coordinate Grid Creation. Do we want to focus on multi-class only in this tutorial ?

@ProGamerGov
Copy link
Contributor Author

ProGamerGov commented Mar 29, 2022

@NarineK I think that we can probably just remove the 'Activation Atlas Shape' section as it's covered in the main atlas tutorial, and it's not particularly important for the class atlas tutorial. I'll also change the first 'Dimensionality Reduction For Coordinate Grid Creation' section's text to be more simplified like in part 2 of the tutorial:

After filtering our activation samples, we can now create the atlas xy coordinate graph. To do this, we'll use UMAP to reduce the number of channels down to 2 to create the x and y axes of our graph.

I tried to structure the class atlas tutorial so that it was similar to the first atlas tutorial, to make it easier to understand. Due to the similarities between both atlas tutorials, there are some sections of text that are repeated across both tutorials. Some repetition was unavoidable and it helps individuals refresh their knowledge on the subject.

@NarineK
Copy link
Contributor

NarineK commented Mar 30, 2022

ProGamerGov

@ProGamerGov, if it is text description, similarity it is fine. If those are functions that are shared between 2 tutorials you can put them in a python file under:

tutorials/optimviz/atlas/ ...

@NarineK
Copy link
Contributor

NarineK commented Mar 31, 2022

ProGamerGov

@ProGamerGov, if it is text description, similarity it is fine. If those are functions that are shared between 2 tutorials you can put them in a python file under:

tutorials/optimviz/atlas/ ...

To avoid duplicates you can also refer to the other notebook from this notebook. So that the users can check out the other one first.

@ProGamerGov
Copy link
Contributor Author

@NarineK So actually other than the two items that you mentioned, I don't think there's any other duplication of the other atlas tutorial.

@NarineK NarineK self-requested a review April 11, 2022 01:35
Copy link
Contributor

@NarineK NarineK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ProGamerGov, thank you for the PR and sorry for the delay reviewing it.

Here are some minor comments:

  1. nit: multi-class ? (seen at several places)
  2. The class-specific version that only focuses on the specified class. -> Maybe this bullet point can come first ?
  3. So, there are two versions: class-specific  and class-specific with context ? What is the context in that case ? Maybe you can describe it a little bit ?
  4. In the section Dimensionality Reduction For Coordinate Grid Creation do you mind adding a description on how to interpret sample activation atlas ?
  5. we will used Captum.optim's  -> we will use ... ?
  6. Wouldn't we get duplicate indices here if some indices in class_indices overlap with top_positive_class_indices ?
  7. Sample Whitening -> Do you mind moving this closer to the section where it is used ?
  8. In the bottom of Rendering The Single Class Activation Atlas Visualizations section maybe you can write a little bit interpretation of the visualized class activation atlas. E.g. On the atlas we recognize high level concepts associated to scuba diver such as ... ?
  9. For the xy coordinate grid do you mind labelling the axes ?

@ProGamerGov
Copy link
Contributor Author

ProGamerGov commented Apr 11, 2022

@NarineK

  1. Fixed!
  2. Done!
  3. The bullet-point section already explains the differences, I think.
  4. The text explains this already I think? The channels are reduced to 2, and are treated as the x and y axes.
  5. Fixed!
  6. Yeah, it seems like there are a few duplicate indices. The research paper's supplementary code also seemingly allows for duplicates, so it could be intentional. I could add torch.unique to though to remove duplicates.
  7. The sampling whitening is used in both sections of the tutorial, so I placed it at the top in order to avoid repeating it for both sections. It's also possible for the user to skip the first atlas section as well.
  8. Done!
  9. Not 100% sure what you mean here?

@NarineK
Copy link
Contributor

NarineK commented Apr 12, 2022

6. supplementary code

Thank you, @ProGamerGov!
4. Does it say that x and y axes are similarity scores ? Maybe such kind of description if it doesn't
9. I meant to add label to x and y axes in the plot. For example, for y-axis on the plot you can write Similarity Score and for the X-axis Class Differences. You describe it in the text but it would bee good to have it as a description of axes as well

* TSNE -> t-SNE
* Added axes labels to second xy graph.
@ProGamerGov
Copy link
Contributor Author

ProGamerGov commented Apr 13, 2022

@NarineK Okay, I've added the labels to the second plotted graph! For the first plotted graph, we can probably leave it as is, as it's created the same way as the graph in the other atlas tutorial. I've added some more information to the first graph about what it represents.

@NarineK
Copy link
Contributor

NarineK commented Apr 14, 2022

Thank you, @ProGamerGov! Merging ...

@NarineK NarineK merged commit 3df1c0a into pytorch:optim-wip Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants