-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Visualization: grayscale images #163
Conversation
…properties output
…adapt the parametrization to grayscale
I had to limit tensorflow to versions <2.16 as the latest updates break a lot of things. Edit: But I'm still getting what seems to be compatibility errors, so it's not due to the tf version... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thank you very much Agus!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I am merging :)
Feature visualization for grayscale images
This PR adapts the code for generating feature visualizations (via Fourier, in pixel space, and using MaCo) for models trained on grayscale images.
In the case of grayscale images, no re-correlation is needed when optimizing in the Fourier domain (standard and MaCo). However, there is no standardized dataset that would generally work on any grayscale application (like ImageNet for natural images), so a dataset must be provided to compute the average magnitude for MaCo.
Disclaimer: Depending on the model under study, the optimization process can provide images that are really difficult to interpret. It seems to work much better on 1-Lipschitz models (trained using DEEL-LIP) and sometimes MaCo helps to generate better visualizations.
It responds to the feature requested in #148
Fix CI
The release of TF 2.16 integrates Keras 3.X, which seems to break some functionality. I've limited the installation of TF to <2.16.
Also, the release of NumPy 2.X breaks packages that were compiled using 1.X, and this includes TF. Thus, I've limited NumPy to 1.X.