davidbau / dissect

Code for the Proceedings of the National Academy of Sciences 2020 article, "Understanding the Role of Individual Units in a Deep Neural Network"
Other
301 stars 50 forks source link

Dissecting my own networks and datasets #1

Closed cianeastwood closed 4 years ago

cianeastwood commented 4 years ago

Hi David,

Thank you for this great resource, and great paper!

If I wanted to "dissect" my own network on my own dataset, what would be the best approach? Start with dissect_classifier_experiment.ipynb and just edit where necessary / an error shows up?

Thanks,

Cian

davidbau commented 4 years ago

Yes -

  1. you can add some code to experiment/setting.py functions load_classifier and load_dataset etc and go from there. For finding semantic labels, the method will work best on networks trained on natural photographs that have recognizable objects. (Although you can always visualize units even if they are hard to label.)

  2. Once you plug in your network to analyze, you may find that some of the steps in dissect_classifier_experiment.ipynb may take some time to complete.  Of course you can reduce sample sizes to take a quick look. That is what I do in the tutorial colab notebooks linked to on dissect.csail.mit.edu.

  3. When you are ready to collect data from a large sample size, you can use experiment/dissect_experiment.py(see dissect_all.sh) as a guide for precomputing data in batch.  Then dissect_classifier_experiment.ipynb can load the cached data instead of computing it inside the notebook.

cianeastwood commented 4 years ago

Fantastic. Thanks for the detailed response!