|
1 |
| -# Captum "optim" module |
| 1 | +Overview |
| 2 | +================= |
2 | 3 |
|
3 |
| -This is a WIP PR to integrate existing feature visualization code from the authors of `tensorflow/lucid` into captum. |
4 |
| -It is also an opportunity to review which parts of such interpretability tools still feel rough to implement in a system like PyTorch, and to make suggestions to the core PyTorch team for how to improve these aspects. |
| 4 | +About Optim |
| 5 | +----------------- |
5 | 6 |
|
6 |
| -## Roadmap |
| 7 | +The Optim module is a set tools for optimization based interpretability for neural networks. It is a continuation of the research work performed by the team behind the [tensorflow/lucid](https://github.com/tensorflow/lucid) library. |
7 | 8 |
|
8 |
| -* unify API with Captum API: a single class that's callable per "technique"(? check for details before implementing) |
9 |
| -* Consider if we need an abstraction around "an optimization process" (in terms of stopping criteria, reporting losses, etc) or if there are sufficiently strong conventions in PyTorch land for such tasks |
10 |
| -* integrate Eli's FFT param changes (mostly for simplification) |
11 |
| -* make a table of PyTorch interpretability tools for readme? |
12 |
| -* do we need image viewing helpers and io helpers or throw those out? |
13 |
| -* can we integrate paper references closer with the code? |
| 9 | + |
| 10 | +The Optim module is designed to be extremely customizable, as to avoid limitations in its research potential. |
| 11 | + |
| 12 | +History |
| 13 | +----------------- |
| 14 | + |
| 15 | +The initial concept for the Optim module was devised by Ludwig Shubert, and then developed by Ben Egan and Swee Kiat Lim with help from Chris Olah & Narine Kokhlikyan. |
| 16 | + |
| 17 | + |
| 18 | +Optim Structure |
| 19 | +----------------- |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +The standard rendering process works like this for the forward pass, with loss objectives being able to target any of the steps: |
| 24 | + |
| 25 | +* ``NaturalImage`` (``ImageParameterization`` ➔ ``ToRGB`` ➔ Squash Function ➔ ``ImageTensor``) ➔ Transforms ➔ Model |
| 26 | + |
| 27 | + |
| 28 | +Parameterizations |
| 29 | +----------------- |
| 30 | + |
| 31 | +The default settings store image parameters in a fully decorrelated format where the spatial information and channel information is decorrelated. By preconditioning our optimizer with decorrelated data, we alter the loss landscape to make optimization significantly easier and decrease the presence of high frequency patterns. Parameterizations like these are also known as a differentiable image parameterizations. |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +* Decorrelated Data ➔ Recorrelate Spatial ➔ Recorrelate Color ➔ Squash Function ➔ Transforms ➔ Model |
| 36 | + |
| 37 | +By default, recorrelation occurs entirely within the ``NaturalImage`` class. |
| 38 | + |
| 39 | + |
| 40 | +Submodules |
| 41 | +----------------- |
| 42 | + |
| 43 | +**Reducer**: The reducer module makes it easy to perform dimensionality reduction with a wide array of algorithms like [t-SNE](https://scikit-learn.org/stable/modules/generated/sklearn.manifold.TSNE.html), [UMAP](https://umap-learn.readthedocs.io/en/latest/), [PCA](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html), & [NMF](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.NMF.html). |
| 44 | + |
| 45 | +**Circuits**: The circuits module allows for the extraction of meaningful weight interactions from between neurons which aren’t literally adjacent in a neural network. |
| 46 | + |
| 47 | +**Models**: The models module contains the model zoo of pretrained models along with various help functions and classes. |
| 48 | + |
| 49 | +**Dataset**: The dataset module provides functions for calculating color correlation matrices of image datasets. |
| 50 | + |
| 51 | + |
| 52 | +Docs |
| 53 | +----------------- |
| 54 | + |
| 55 | +The docs for the optim module can be found [here](https://captum.ai/api/). |
| 56 | + |
| 57 | + |
| 58 | +Tutorials |
| 59 | +----------------- |
| 60 | + |
| 61 | +We also provide multiple tutorials covering a wide array of research for the optim module [here](https://captum.ai/tutorials/). |
| 62 | + |
| 63 | + |
| 64 | +References |
| 65 | +----------------- |
| 66 | + |
| 67 | +* Feature Visualization: https://distill.pub/2017/feature-visualization/ |
| 68 | + |
| 69 | +* Differentiable Image Parameterizations: https://distill.pub/2018/differentiable-parameterizations/ |
| 70 | + |
| 71 | +* The Building Blocks of Interpretability: https://distill.pub/2018/building-blocks/ |
| 72 | + |
| 73 | +* Exploring Neural Networks with Activation Atlases: https://distill.pub/2019/activation-atlas/ |
| 74 | + |
| 75 | +* Understanding Deep Image Representations by Inverting Them: https://arxiv.org/abs/1412.0035 |
| 76 | + |
| 77 | +* Color information for region segmentation: https://www.sciencedirect.com/science/article/pii/0146664X80900477 |
| 78 | + |
| 79 | +* Thread: Circuits: https://distill.pub/2020/circuits/ |
| 80 | + |
| 81 | + * Visualizing Weights: https://distill.pub/2020/circuits/visualizing-weights/ |
| 82 | + |
| 83 | + * Weight Banding: https://distill.pub/2020/circuits/weight-banding/ |
| 84 | + |
| 85 | +* Multimodal Neurons in Artificial Neural Networks: https://distill.pub/2021/multimodal-neurons/ |
0 commit comments