Working on the following set of features:
- Unit testing and proper coverage.
- Simplifying the interface.
- Adding compiled versions of the ECT.
- Rendering based inversion for the ECT (Point clouds only).
- Optional: Benchmarks.
This is the official implementation for the Differentiable Euler Characteristic
Transform, a geometrical-topological method for shape classification. Our
implementation is fully optimized for hardware acceleration,
yielding a blazingly fast implementation for machine learning research with
PyTorch
.
For the installation we require an up-to-date installation of PyTorch, either with or without CUDA support. Our package can be installed with either pip or added as a git submodule.
Installation as a git submodule can be done as follows.
git submodule add https://github.com/aidos-lab/dect.git
Or use pip to install the git repository.
pip install git+https://github.com/aidos-lab/dect.git
For a demonstrastration of our new ECT computation, we provide the
notebooks/01_example_usage.ipynb
file and the code therein provides an intuitive
example with explanation. The code is provided on an as-is basis; see
LICENSE.md for more
information. You are cordially invited to both contribute and provide feedback.
Do not hesitate to contact us!
import torch
from dect.directions import generate_2d_directions
from dect.ect import compute_ect
from dect.ect_fn import scaled_sigmoid
# Added for visualization.
import matplotlib.pyplot as plt
# Basic dataset with three points,three edges and one face.
points_coordinates = torch.tensor([[0.5, 0.0], [-0.5, 0.0], [0.5, 0.5]])
# Generate a set of structured directions along the unit circle.
v = generate_2d_directions(num_thetas=64)
# Compute the ECT.
ect = compute_ect(
points_coordinates,
v=v,
radius=1,
resolution=64,
scale=500,
ect_fn=scaled_sigmoid
)
# Visualize as an image.
plt.imshow(ect.detach().squeeze().numpy().T)
plt.show()
Our code is released under a BSD-3-Clause license. This license essentially permits you to freely use our code as desired, integrate it into your projects, and much more --- provided you acknowledge the original authors. Please refer to LICENSE.md for more information.
We welcome contributions and suggestions for our DECT package! Here are some basic guidelines for contributing:
-
Check Existing Issues: Before submitting a new issue, please check if it has already been reported.
-
Open a New Issue: If your issue is new, open a new issue in the repository. Provide a clear and detailed description of the problem, including steps to reproduce the issue if applicable.
-
Include Relevant Information: Include any relevant information, such as system details, version numbers, and screenshots, to help us understand and resolve the issue more efficiently.
If you're unfamiliar with contributing to open source repositories, here is a basic roadmap:
-
Fork the Repository: Start by forking the repository to your own GitHub account.
-
Clone the Repository: Clone the forked repository to your local machine.
git clone https://github.com/your-username/dect.git
-
Create a Branch: Create a new branch for your feature or bug fix.
git checkout -b feature/your-feature-name
-
Make Changes: Implement your changes in the new branch.
-
Commit Changes: Commit your changes with a descriptive commit message.
git commit -m "Description of your changes"
-
Push Changes: Push the changes to your forked repository.
git push origin feature/your-feature-name
-
Submit a Pull Request: Open a pull request to the main repository with a clear description of your changes and the purpose of the contribution.
If you need any help or have questions, feel free to reach out to the authors or submit a pull request. We appreciate your contributions and are happy to assist!
If you find our work useful, please consider using the following citation:
@inproceedings{Roell24a,
title = {Differentiable Euler Characteristic Transforms for Shape Classification},
author = {Ernst R{\"o}ell and Bastian Rieck},
year = 2024,
booktitle = {International Conference on Learning Representations},
eprint = {2310.07630},
archiveprefix = {arXiv},
primaryclass = {cs.LG},
repository = {https://github.com/aidos-lab/dect-evaluation},
url = {https://openreview.net/forum?id=MO632iPq3I},
}