Skip to content

Neuron has grey optimal input #34

@TomFrederik

Description

@TomFrederik

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.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions