{"id":20663762,"url":"https://github.com/vita-group/l2pg","last_synced_at":"2025-04-13T10:10:33.965Z","repository":{"id":181078043,"uuid":"643693911","full_name":"VITA-Group/L2PG","owner":"VITA-Group","description":"[ICML 2023] \"Learning to Optimize Differentiable Games\" by Xuxi Chen, Nelson Vadori, Tianlong Chen, Zhangyang Wang","archived":false,"fork":false,"pushed_at":"2023-08-05T07:02:26.000Z","size":193,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-27T01:35:32.402Z","etag":null,"topics":["differentiable-games","learning-to-optimize"],"latest_commit_sha":null,"homepage":"","language":"Python","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/VITA-Group.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-22T00:31:56.000Z","updated_at":"2024-07-29T08:26:16.000Z","dependencies_parsed_at":"2024-11-16T21:16:41.976Z","dependency_job_id":null,"html_url":"https://github.com/VITA-Group/L2PG","commit_stats":null,"previous_names":["vita-group/l2pg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FL2PG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FL2PG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FL2PG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FL2PG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VITA-Group","download_url":"https://codeload.github.com/VITA-Group/L2PG/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695481,"owners_count":21146956,"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":["differentiable-games","learning-to-optimize"],"created_at":"2024-11-16T19:19:44.508Z","updated_at":"2025-04-13T10:10:33.944Z","avatar_url":"https://github.com/VITA-Group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learning to Optimize Differentiable Games\n\nCode for ICML 2023 paper: [Learning to Optimize Differentiable Games](). \n\n## Overview\n\nMany machine learning problems can be abstracted in solving game theory formulations and boil down to optimizing nested objectives, such as generative adversarial networks (GANs) and multi-agent reinforcement learning. \nSolving these games requires finding their stable fixed points or Nash equilibrium. However, existing algorithms for solving games suffer from empirical instability, hence demanding heavy ad-hoc tuning in practice.  \nTo tackle these challenges, we resort to the emerging scheme of $\\textit{Learning to Optimize}$ (L2O), which discovers problem-specific efficient optimization algorithms through data-driven training. Our customized L2O framework for differentiable game theory problems, dubbed $\\textit{``Learning to Play Games\"}$ (L2PG), seeks a stable fixed point solution, by predicting the fast update direction from the past trajectory, with a novel gradient stability-aware, sign-based loss function. We further incorporate curriculum learning and self-learning to strengthen the empirical training stability and generalization of L2PG. On test problems including quadratic games and GANs, L2PG can substantially accelerate the convergence, and demonstrates a remarkably more stable trajectory.\n\n## Experiments\n\n### Meta-Testing\n\nWe provide checkpoints of the optimizers under the `checkpoints` folder.  \n\n#### Two-player games (stable)\n\n```bash\npython sga_l2o_batch.py --eval_game_list stable_game_list_normal.txt --checkpoint checkpoints/two_player.pkl --n_hidden 32 --formula grad,A,S --feat_level o,m0.5,m0.9,m0.99,mt,gt\n```\n\n#### Four-player games \n\npython sga_l2o_batch_four_player.py  --checkpoint checkpoints/four_player.pkl  --n_hidden 32 --formula grad,S,A --feat_level o,m0.5,m0.9,m0.99,mt,gt --n_player 4\n\n\n#### GANs\n\n### Meta-Training\n\n#### Two-player games\n\n```bash\npython -u sga_l2o_train.py --n_hidden 32 --game-distribution gaussian --formula grad,S,A --inner-iterations 100 --feat_level o,m0.5,m0.9,m0.99,mt,gt --unroll_length 10 --output-name all_cl_0.1_reg_2_0.95.pkl --eval-game-list stable_game_list_new.txt --init-mode ball  --use-slow-optimizer --use-slow-ema --slow-optimizer-freq 5 --epoch 300 --wandb-name all_cl_0.1_reg_2_0.95 --slow-ema 0.95 --slow-optimizer-start 0.1  --cl --reg_2 --data-cl --batch-size 128 \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvita-group%2Fl2pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvita-group%2Fl2pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvita-group%2Fl2pg/lists"}