This is the official PyTorch implementation for the paper:
SymmetricDiffusers: Learning Discrete Diffusion on Finite Symmetric Groups
Authors: Yongxing Zhang, Donglin Yang, Renjie Liao
Abstract: Finite symmetric groups
arXiv: https://arxiv.org/abs/2410.02942
OpenReview: https://openreview.net/forum?id=EO8xpnW7aX¬eId=YnhKXSiiLN
Please consider citing our paper in your publications if it helps. Here is the bibtex:
@article{zhang2024symmetricdiffusers,
title={SymmetricDiffusers: Learning Discrete Diffusion on Finite Symmetric Groups},
author={Zhang, Yongxing and Yang, Donglin and Liao, Renjie},
journal={arXiv preprint arXiv:2410.02942},
year={2024}
}
Install requirements:
pip install -r requirements.txt
The dataset we use for sorting 4-digit MNIST numbers is generated on the fly using the MNIST dataset. The MNIST dataset will be downloaded automatically when running the code.
When dividing up an MNIST image into patches, there may be identical background patches which are all black and indistinguishable. To avoid such scenerios, we add Gaussian noises to the MNIST dataset to obtain the NoisyMNIST dataset. Google drive link: https://drive.google.com/drive/folders/12vGK6YE8S6LmMeNWEWyxS0unLvS7P8ue?usp=sharing
The train set is train_noisy_mnist.pt
.
The test sets are test_noisy_mnist_num_pieces=i.pt
, where i
ranges from 2 to 6.
The test sets are images that are already pre-chunked. (We don't want to randomly chunk the images each time we run a test.) num_pieces
is the number of pieces per side, so that there would be a total number of num_pieces**2
pieces.
We use the TSP-20 dataset from https://github.com/chaitjo/learning-tsp?tab=readme-ov-file. You can download from
pip install gdown
gdown https://drive.google.com/uc?id=152mpCze-v4d0m9kdsCeVkLdHFkjeDeF5
tar -xvzf tsp-data.tar.gz data/tsp/
We use json files for configs.
For the keys and the descriptions of the keys, please see configs/config_descriptions.json
.
For training and then eval, set the eval_only
key in the config file to false
.
For evaluation only, set the eval_only
key in the config file to true
.
Run
torchrun --standalone --nproc_per_node=4 \
main.py \
--config_json $PATH_TO_CONFIG_FILE \
--ckpt_dir $PATH_TO_CKPT_DIR \
--gpu "0,1,2,3"
Remember to change the number of GPUs accordingly.