Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.5%) to scientific vocabulary
Repository
A method to generate counterfactuals
Basic Info
Statistics
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 2
Metadata Files
README.md
Latent Shift - A Simple Autoencoder Approach to Counterfactual Generation
The idea
Read the paper about Latent Shift: https://arxiv.org/abs/2102.09475
Watch a video: https://www.youtube.com/watch?v=1fxSDP8DheI
Read the paper about Counterfactual Alignment: https://arxiv.org/abs/2312.02186
The main diagram:

Animations/GIFs
| Smiling | Arched Eyebrows
|
| ----------- | ----------- |
|
|
|
|Mouth Slightly Open | Young
|
| ----------- | ----------- |
|
|
|
Generating a transition sequence
For a predicting of smiling

Multiple different targets

Comparison to traditional methods
For a predicting of pointy_nose

Getting Started
bash
$pip install latentshift
`
```python3 import latentshift
Load classifier and autoencoder
model = latentshift.classifiers.FaceAttribute(download=True) ae = latentshift.autoencoders.VQGAN(weights="faceshq", download=True)
Load image
input = torch.randn(1, 3, 1024, 1024)
Defining Latent Shift module
attr = captum.attr.LatentShift(model, ae)
Computes counterfactual for class 3.
output = attr.attribute(input, target=3) ```
Owner
- Name: Joseph Paul Cohen
- Login: ieee8023
- Kind: user
- Website: https://josephpcohen.com
- Twitter: josephpaulcohen
- Repositories: 75
- Profile: https://github.com/ieee8023
Amazon, Butterfly Network, Stanford AIMI, Mila, Director: Institute for Reproducible Research, MLMed.org, AcademicTorrents.com, ShortScience.org
Citation (CITATION)
@article{cohen2021gif,
title = {{Gifsplanation via Latent Shift: A Simple Autoencoder Approach to Counterfactual Generation for Chest X-rays}},
author = {Cohen, Joseph Paul and Brooks, Rupert and En, Sovann and Zucker, Evan and Pareek, Anuj and Lungren, Matthew P. and Chaudhari, Akshay},
journal = {Medical Imaging with Deep Learning},
url = {https://arxiv.org/abs/2102.09475},
year = {2021}
}
GitHub Events
Total
- Release event: 1
- Watch event: 3
- Push event: 4
- Pull request event: 2
- Create event: 2
Last Year
- Release event: 1
- Watch event: 3
- Push event: 4
- Pull request event: 2
- Create event: 2
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 0
- Total pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ieee8023 (1)
Pull Request Authors
- ieee8023 (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 182 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 6
- Total maintainers: 1
pypi.org: latentshift
A method to generate counterfactuals
- Homepage: https://github.com/ieee8023/latentshift
- Documentation: https://latentshift.readthedocs.io/
- License: Apache Software License
-
Latest release: 0.0.6
published 12 months ago