{"id":19199846,"url":"https://github.com/rose-stl-lab/liegan","last_synced_at":"2025-05-09T01:28:51.290Z","repository":{"id":170468981,"uuid":"646593367","full_name":"Rose-STL-Lab/LieGAN","owner":"Rose-STL-Lab","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-16T21:54:13.000Z","size":18430,"stargazers_count":33,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-17T09:32:03.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rose-STL-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-28T22:04:21.000Z","updated_at":"2025-04-16T21:54:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f0eaa59-c3ba-4ce1-a77e-4985704fbb3e","html_url":"https://github.com/Rose-STL-Lab/LieGAN","commit_stats":null,"previous_names":["rose-stl-lab/liegan"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rose-STL-Lab%2FLieGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rose-STL-Lab%2FLieGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rose-STL-Lab%2FLieGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rose-STL-Lab%2FLieGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rose-STL-Lab","download_url":"https://codeload.github.com/Rose-STL-Lab/LieGAN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253173652,"owners_count":21865730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T12:29:11.018Z","updated_at":"2025-05-09T01:28:51.283Z","avatar_url":"https://github.com/Rose-STL-Lab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generative Adversarial Symmetry Discovery (LieGAN)\nCode for the ICML 2023 paper, [Generative Adversarial Symmetry Discovery](https://arxiv.org/abs/2302.00236).\n\n![image](./LieGAN.jpg)\n\n## Experiments\n### N-Body Trajectory\nTo discover symmetry from the task of 2-body trajectory prediction, run one of the following:\n```\n# LieGAN\npython main_lagan.py --g_init 2*2_factorization --lamda 1 --sigma_init 1 --num_epochs 100\n# Augerino*\npython main_augerino.py --g_init 2*2_factorization --lamda 1 --num_epochs 100\n# SymmetryGAN\npython main_lagan.py --g_init 2*2_factorization --lamda 1 --sigma_init 1 --num_epochs 100 --model sgan\n```\n\nTo discover symmetry in a larger search space (Figure 3c), run the following:\n```\npython main_lagan.py --g_init 4*4_factorization --lamda 1e1 --sigma_init 3 --num_epochs 100\n```\n\nTo run the prediction experiments for EMLP and data augmentation, refer to `emlp.ipynb` and `aug_pred.ipynb`. We have provided the discovery results used for these experiments in `./saved_model/results/`.\n\nAs is stated in Section 5.2 in our paper, we need to slightly modify the EMLP implementation of SVD. It is located in line 307 of `emlp/reps/representation.py`, where we need to change the threshold from 1e-5 to larger values, like 5e-3.\n\nTo discover symmetry from the task of 3-body trajectory prediction:\n```\npython main_lagan.py --task traj_pred_3body --dataset_name 3body --g_init 2*2_factorization --lamda 1 --sigma_init 1\n```\n\n### Discrete Rotation Invariant Regression\n```\npython main_lagan.py --task discrete_rotation_synthetic --dataset_size 20000 --y_type scalar --coef_dist uniform_int_grid --uniform_max 10\n```\n\n### Top Tagging\nTo discover symmetry, first download the [top tagging dataset](https://zenodo.org/record/2603256) to `./data/top-tagging`. We only need `train.h5` for symmetry discovery purpose. Then run the following command:\n```\npython main_lagan.py --task top_tagging --lamda 1 --g_init random --n_channel 7 --y_type scalar --sigma_init 1 --eta 0.1 --n_component 2\n```\n\nTo run the top tagging prediction task, first download the converted dataset from [this link](https://osf.io/7u3fk/?view_only=8c42f1b112ab4a43bcf208012f9db2df) to the data directory `./data/top-tagging-converted`. Then,\n```\ncd LorentzNet\n```\nThe content of this directory is modified from the codebase of [LorentzNet](https://github.com/sdogsq/LorentzNet-release). We mainly made our modifications in the file `models.py`, where we implemented LieGNN as proposed in our paper. To run the experiments:\n```\n# LorentzNet (original)\npython -m torch.distributed.launch --nproc_per_node=4 top_tagging.py \\\n        --batch_size=32 --epochs=35 --warmup_epochs=5 \\\n        --n_layers=6 --n_hidden=72 --lr=3e-4 \\\n        --c_weight=0.005 --dropout=0.2 --weight_decay=0.01 \\\n        --exp_name=lorentznet --datadir ../data/top-tagging-converted\n# LieGNN (symmetry discovered by LieGAN)\npython -m torch.distributed.launch --nproc_per_node=4 top_tagging.py \\\n        --batch_size=32 --epochs=35 --warmup_epochs=5 \\\n        --n_layers=6 --n_hidden=72 --lr=3e-4 \\\n        --c_weight=0.005 --dropout=0.2 --weight_decay=0.01 \\\n        --exp_name=liegnn --datadir ../data/top-tagging-converted --metric saved_metric/metric_liegan.pt\n# Augerino+GNN (symmetry discovered by Augerino+)\npython -m torch.distributed.launch --nproc_per_node=4 top_tagging.py \\\n        --batch_size=32 --epochs=35 --warmup_epochs=5 \\\n        --n_layers=6 --n_hidden=72 --lr=3e-4 \\\n        --c_weight=0.005 --dropout=0.2 --weight_decay=0.01 \\\n        --exp_name=augerino --datadir ../data/top-tagging-converted --metric saved_metric/metric_augerino.pt\n```\n\n### Rotated MNIST\n```\npython main_lagan.py --task MNIST --g_init affine --x_type grid --y_type scalar --lamda 0.1 --lr_g 2e-4 --reg_type fourier --num_epochs 15\n```\n\n## Cite\n```\n@article{yang2023generative,\n  title={Generative Adversarial Symmetry Discovery},\n  author={Yang, Jianke and Walters, Robin and Dehmamy, Nima and Yu, Rose},\n  booktitle={International Conference on Machine Learning},\n  organization={PMLR},\n  year={2023}\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frose-stl-lab%2Fliegan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frose-stl-lab%2Fliegan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frose-stl-lab%2Fliegan/lists"}