lucent
lucent copied to clipboard
Neuron has grey optimal input
For some neurons the optimized image is simply grey. This does not happen when choosing objectives.channel
Minimal example for colab:
!pip install torch-lucent
import torch
import torchvision as tv
from lucent.optvis import render, objectives, transform, param
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = tv.models.googlenet(pretrained=True).to(device)
model.eval()
param_f = lambda: param.image(64, decorrelate=False, fft=True)
objs = [objectives.neuron('inception3b_branch2_1', i) for i in range(3)]
for i, obj in enumerate(objs):
_ = render.render_vis(model, obj, param_f, thresholds=(256,), show_inline=True)
# for i = 1 the image will be grey, if fft=False, then i=2 will also be grey.