Skip to content

Full Implementation of the Captum-Optim Module#1545

Open
ProGamerGov wants to merge 908 commits intometa-pytorch:masterfrom
ProGamerGov:master-optim
Open

Full Implementation of the Captum-Optim Module#1545
ProGamerGov wants to merge 908 commits intometa-pytorch:masterfrom
ProGamerGov:master-optim

Conversation

@ProGamerGov
Copy link
Contributor

@ProGamerGov ProGamerGov commented Apr 21, 2025

So this project got left on the back burner for a while but I've brought it back. The original plan was to either merge it into Captum or spin it out as a separate library under the PyTorch umbrella. The project was almost ready for release before it was paused, and I have since pushed it closer to full release quality.

The ReadMe for the module can be found here: https://github.com/ProGamerGov/captum/tree/master-optim/captum/optim

This PR contains all the following PR merged together:

#983
#968
#967
#966
#965
#961
#960
#957
#955
#955
#951
#949
#946
#945
#943
#927
#828

The module was developed based on this initial starting PR: #412

The last PR reviewed by the Captum team, was this one: #935

As part of this project, numerous improvements were made to Captum and the libraries that it is dependent on:

…o ImageTensor (meta-pytorch#839)

* Add better colorspace support, image grids, & user agent to ImageTensor

* Added color space support to `save_tensor_as_image` & `ImageTensor.export`.
* Added image grid creation support to `ImageTensor.export` , `ImageTensor.show` , `show` & `save_tensor_as_image` via a new `make_grid_image` function.
* Added user agent to `ImageTensor.open` as sites like Wikipedia require user agents.

* Add description to make_grid_image tests

* `nrow` -> `images_per_row`

* Remove test description

It's no longer required now that the images_per_row variable was renamed.

* Add missing tests

* Fix test
* Ensure testing coverage is as high as possible.
* Simplified code with new `rmodule_op` function.
* Removed the NumPy import from loss testing.
* Fix duplicated target bug

* Fix duplicated target bug in `sum_loss_list` & `collect_activations`

* Add ToDo comment for target handling
* Wrap all remaining `torch.__version__` calls in `version.parse`.
* Remove unused version check in `typing.py`.
* Expose `MaxPool2dRelaxed` to users so that tutorials using it work.
* Expose `dataset` module to users.
* Fixed `show` & `save_tensor_as_image` docs.
* Improve efficiency of the `FacetLoss` objective.
* Add missing docs.
* Fix errors in existing docs.
@craymichael
Copy link
Contributor

Hi @ProGamerGov, I wanted to leave a quick comment - thank you for bringing this project back to light! This is a big and exciting contribution, but will definitely take us some time to review it thoroughly. It's busy right now, but I will discuss this with the team and plan how we will deliver a timely review. We appreciate your patience and contributions.

@ProGamerGov
Copy link
Contributor Author

@craymichael Awesome, thank you for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants