ViCCo-Group / thingsvision

Python package for extracting representations from state-of-the-art computer vision models
https://vicco-group.github.io/thingsvision/
MIT License
157 stars 21 forks source link

Deprecate `module_name` and automatically perform extraction for all available modules? #89

Open LukasMut opened 2 years ago

andropar commented 2 years ago

Suggestion: Let user provide either None for all modules, str for single module or List for multiple modules. This should also probably come after #74.

LukasMut commented 2 years ago

This sounds reasonable. We should probably only accept None or List[str]. For a single module, the list contains only a single element.

LukasMut commented 2 years ago

For this, we want to use defaultdict(list) from collections and append features for every module.

PhilippKaniuth commented 2 years ago

I second letting users provide names. Otherwise, some users might be suprised/confused how much of their storage - depending on the network they chose - is now filled with activations for dozens of modules :)

I'm not sure if I'd go with None for all modules though. It might be more intuitive to require the string all. But I can't evaluate whether that makes things ugly or harder to maintain code-wise :) Just my 2 cents.

andropar commented 2 years ago

I think making extracting all modules more explicit makes sense, otherwise you could just do it by accident. Maybe the best option would be to only allow List[str] and if the user really wants to extract everything, he could just do module_names=extractor.get_modules_names()? I think that's an edge case anyway