Flashtorch

Latest version: v0.1.3

Safety actively analyzes 619516 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.3

Install steps
- `pip install flashtorch`

Upgrade steps
- `pip install flashtorch -U`

Breaking changes
- None

New features
- None

Bug fixes
- None

Improvements
- Requested improvement: 30
- Implemented by 31
- Quick summary: `flashtorch.saliency.Backprop` can now handle models with mono-channel/grayscale input images

Other changes
- None

0.1.2

Install steps
- `pip install flashtorch`

Upgrade steps
- `pip install flashtorch -U`

Breaking changes
- None

New features
- None

Bug fixes
- Reported bug: 18
- Fixed by: 25
- Quick summary: `flashtorch.saliency.Backprop.visualize` now correctly passes `use_gpu` flag down to the `calculate_gradient`.

Improvements
- None

Other changes
- None

0.1.1

Install steps
- `pip install flashtorch`

Upgrade steps
- `pip install flashtorch -U`

Breaking changes
- None

New features
- None

Bug fixes
- Removes a dependency on `README.md` in `setup.py`: this is to avoid getting unicode decoding error (reported by 14). `setup.py` now gets the `long_description` from its docstring.

Improvements
- None

Other changes
- None

0.1.0

Install steps
- `pip install flashtorch`

Upgrade steps
- `pip install flashtorch -U`

Breaking changes
- `flashtorch.utils.visualize`: This functionality was specific for creating saliency maps, and therefore has been moved as a class method for `flashtorch.saliency.Backprop`

Refer to the notebooks below for details and how to use it:

- [Image-specific class saliency map with backpropagation](https://github.com/MisaOgura/flashtorch/blob/master/examples/visualise_saliency_with_backprop.ipynb)
- [Google Colab version](https://colab.research.google.com/github/MisaOgura/flashtorch/blob/master/examples/visualize_saliency_with_backprop_colab.ipynb): best for playing around

New features
- `flashtorch.activmax.GradientAscent`: This is a new API which implements activation maximization via gradient ascent. It has three public facing APIs:

- `GradientAscent.optimize`: Generates an image that maximally activates the target filter.
- `GradientAscent.visualize`: Optimizes for the target layer/filter and visualizes the output.
- `GradientAscent.deepdream`: Creates DeepDream.

Refer to the notebooks below for details and how to use it:

- [Activation maximization](https://github.com/MisaOgura/flashtorch/blob/master/examples/activation_maximization.ipynb)
- [Google Colab version](https://colab.research.google.com/github/MisaOgura/flashtorch/blob/master/examples/activation_maximization_colab.ipynb): best for playing around

Bug fixes
- None

Improvements
- `flashtorch.utils.standardize_and_clip`: Users can optionally set the `saturation` and `brightness`.

Other changes
- None

0.0.8

Install steps
- `pip install flashtorch`

Upgrade steps
- `pip install flashtorch -U`

Breaking changes
- None

New features
- None

Bug fixes
- Fixes 2

Improvements
- Users can explicitly set a device to use when calculating gradients when using an instance of `Backprop`, by setting `use_gpu=True`. If it's True and `torch.cuda.is_available`, the computation will be moved to GPU. It defaults to `False` if not provided.


from flashtorch.saliency import Backprop

... Prepare input and target_class

model = model()
backprop = Backprop(model)
gradients = backprop. calculate_gradients(input, target_class, use_gpu=True)


Other changes
- `setup.py` has better indications of supported Python versions

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.