Note: This project is in the early stages of development and is currently public for development purposes only. It is not yet ready for production use.
GraphDiffusion is a repository for the graphdiffusion
, a Python/PyTorch package designed for educational purposes. It focuses on the application of diffusion models to graphs and point clouds, offering a novel approach to understanding and manipulating these data structures.
- PyTorch Integration: Built on PyTorch and PyTorch Geometric, leveraging their powerful and flexible computing frameworks.
- User-Friendly: Extremely easy to use, offering off-the-shelf commands for a variety of use cases.
- Versatile Data Handling: Compatible with various data types, including:
- Vectors (normal PyTorch Tensors)
- Images
- Graphs
- Point Clouds
- Molecules
- Wasserstein Distance: Employs the Wasserstein distance metric for automatic comparison between the distributions of original and generated data.
- Rich Visualization: Offers diverse options for visualizing both the degradation/forward process and the reconstruction/reverse process.
- Extensibility: Designed with flexibility in mind, allowing users to easily integrate their own Python functions into the framework.
We support multiple types of flow models, including:
- denoising diffusion probabilistic models (DDPM)
- normalizing flow models (NFM)
- conditional flow
- SDE-based models
- Degradation and Reconstruction: This approach is favored over the typical forward and backward process, allowing a more intuitive understanding of the diffusion process.
- Time Scale: The process is measured from 0 (original sample) to 1 (completely destructed, e.g., random noise), offering a clear, linear progression.
- Degradation/Forward Process: This does not need to be a stochastic (Markov) process. Instead, you can jump directly to a randomly sampled time
t
. - Scheduler: The model does not require a separate scheduler. The degradation process implicitly handles scheduling.
-
Install Anaconda.
-
Create and activate a new environment, then install the package. Ensure you are in the topmost 'graphdiffusion' directory:
conda env create -f environment.yml -n graphdiffusionenv conda activate graphdiffusionenv pip install -e .
-
To run the example code, navigate to the examples directory:
cd examples python example.py
To run the tests, execute the following command in the topmost 'graphdiffusion' directory:
python -m pytest
Currently not supported.
-
Install Docker.
-
Run the following command:
docker run -p 8888:8888 gerritgr/graphdiffusion:latest
After running the Docker image, manually copy the provided URL to your browser. Navigate to the example folder and activate the graphdiffusion_env kernel (
Kernel -> Change Kernel...
in Jupyter Lab).
Not implemented yet.
(Provide a brief introduction to the project, its goals, and how users can quickly get started with it.)
- Spiral example.
- Compontents of the diffusion pipeline.
- Image example.
- Graph example.
- Molecule example.
- Point cloud example.
- Conditional models.
- Hyperparameter tuning and WandB integration.
todo
- ImagePipeline
- add time dim and conditioning dim to the pipeline
- add "create from data" method to the pipeline
- graphs
- wandb
- conditioning
- better config
- ability to save/pickle and load the whole pipeline
- include readthedocs