Feature visualization to make deep neural networks more interpretable
Project description
torch-dreams
Making deep neural networks more interpretable, one octave at a time.
pip install torch-dreams --upgrade
Contents:
- You might want to read:
- Notebooks:
- Images:
Quick start
This is a very simple example. For advanced functionalities like simultaneous optimization of channels/layers/units, check out the quick start notebook
- Importing the good stuff
import os
import matplotlib.pyplot as plt
import torchvision.models as models
from torch_dreams.dreamer import dreamer
- Initiating
torch_dreams.dreamer
and selecting a layer to optimize on
model = models.inception_v3(pretrained=True)
dreamy_boi = dreamer(model)
layer = model.Mixed_5d
layers_to_use = [layer] ## feel free to add more layers
- Showtime
os.system("wget https://raw.githubusercontent.com/Mayukhdeb/torch-dreams/master/images/noise.jpg")
out_single_layer = dreamy_boi.deep_dream(
image_path = "noise.jpg",
layers = layers_to_use,
octave_scale = 1.3,
num_octaves = 7,
iterations = 100,
lr = 0.9
)
plt.imshow(out_single_layer)
plt.show()
Optimizing noise to activate multiple channels simultaneously within the inceptionv3
Feature visualization through combined optimization of channels
Changes under way:
- Expand
torch_dreams
to facilitate research in neural network interpretability.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torch-dreams-0.1.0.tar.gz
(9.9 kB
view hashes)
Built Distribution
Close
Hashes for torch_dreams-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98e54bf671f5d0da837d721f440fd217a15c15c110e86e87c80a1c5100fa18df |
|
MD5 | b2d9d628d34dca8a25d867c35700f1f1 |
|
BLAKE2b-256 | 8ee0ebb54bf60f023a63c045d7df6c891b649660b01fc3f567fbd7829942c142 |