{"id":21453239,"url":"https://github.com/tianheyu927/pcgrad","last_synced_at":"2026-04-08T14:02:36.486Z","repository":{"id":41302725,"uuid":"259738755","full_name":"tianheyu927/PCGrad","owner":"tianheyu927","description":"Code for \"Gradient Surgery for Multi-Task Learning\"","archived":false,"fork":false,"pushed_at":"2020-04-28T22:44:55.000Z","size":7,"stargazers_count":333,"open_issues_count":13,"forks_count":37,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-09-26T11:43:47.937Z","etag":null,"topics":["deep-learning","deep-reinforcement-learning","multi-task-learning"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tianheyu927.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-28T20:00:29.000Z","updated_at":"2025-09-22T02:35:57.000Z","dependencies_parsed_at":"2022-08-22T04:21:18.820Z","dependency_job_id":null,"html_url":"https://github.com/tianheyu927/PCGrad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tianheyu927/PCGrad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianheyu927%2FPCGrad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianheyu927%2FPCGrad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianheyu927%2FPCGrad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianheyu927%2FPCGrad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tianheyu927","download_url":"https://codeload.github.com/tianheyu927/PCGrad/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianheyu927%2FPCGrad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31558387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["deep-learning","deep-reinforcement-learning","multi-task-learning"],"created_at":"2024-11-23T04:38:48.247Z","updated_at":"2026-04-08T14:02:36.449Z","avatar_url":"https://github.com/tianheyu927.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# PCGrad\n\nThis repository contains code for [Gradient Surgery for Multi-Task Learning](https://arxiv.org/pdf/2001.06782.pdf) in TensorFlow v1.0+ (PyTorch implementation forthcoming).\n\nPCGrad is a form of gradient surgery that projects a task’s gradient onto the normal plane of the gradient of any other task that has a conflicting gradient, which achieves substantial gains in efficiency and performance on a range of supervised multi-task learning and multi-task reinforcement learning domains. Moreover, it is model-agnostic and can be combined with previously-proposed multitask architectures for enhanced performance.\n\n## Installation\nClone this repo and copy `PCGrad_tf.py` to your codebase.\n\n## Usage\n\n```python\noptimizer = PCGrad(tf.train.AdamOptimizer()) # wrap your favorite optimizer\nlosses = # a list of per-task losses\nassert len(losses) == num_tasks\ntrain_op = optimizer.minimize(losses)\n```\n\n## Experiments\n\nOur experiments in the paper were based on the following repositories.\n\nCIFAR-100-MTL: [RoutingNetworks](https://github.com/cle-ros/RoutingNetworks)\n\nNYUv2: [MTAN](https://github.com/lorenmt/mtan)\n\nMultiMNIST: [MultiObjectiveOptimization](https://github.com/intel-isl/MultiObjectiveOptimization)\n\nMT10/MT50/goal-conditioned pushing in [MetaWorld](https://meta-world.github.io/): [softlearning](https://github.com/rail-berkeley/softlearning) with modifications (per-task temperature and per-task replay buffers). We will release modified multi-task softlearning code soon.\n\n\n## Reference\n\nPlease cite as:\n\n```\n@article{yu2020gradient,\n  title={Gradient surgery for multi-task learning},\n  author={Yu, Tianhe and Kumar, Saurabh and Gupta, Abhishek and Levine, Sergey and Hausman, Karol and Finn, Chelsea},\n  journal={arXiv preprint arXiv:2001.06782},\n  year={2020}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftianheyu927%2Fpcgrad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftianheyu927%2Fpcgrad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftianheyu927%2Fpcgrad/lists"}