{"id":14080901,"url":"https://github.com/auto-differentiation/xad-py","last_synced_at":"2026-01-14T23:44:43.568Z","repository":{"id":231316098,"uuid":"781408516","full_name":"auto-differentiation/xad-py","owner":"auto-differentiation","description":"High-Performance Automatic Differentiation for Python","archived":false,"fork":false,"pushed_at":"2024-09-02T16:38:41.000Z","size":161,"stargazers_count":13,"open_issues_count":12,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-30T20:38:38.960Z","etag":null,"topics":["automatic-differentiation","biotechnology","computer-graphics","derivatives","machine-learning","meteorology","numerical-analysis","optimisation","quant-finance","risk-management","robotics","scientific-computing"],"latest_commit_sha":null,"homepage":"https://auto-differentiation.github.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/auto-differentiation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-03T10:23:03.000Z","updated_at":"2025-05-16T13:20:10.000Z","dependencies_parsed_at":"2024-04-03T13:41:51.330Z","dependency_job_id":"6f72ca4d-aa11-4246-9d8d-420df785ed22","html_url":"https://github.com/auto-differentiation/xad-py","commit_stats":null,"previous_names":["auto-differentiation/xad-py"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/auto-differentiation/xad-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auto-differentiation%2Fxad-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auto-differentiation%2Fxad-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auto-differentiation%2Fxad-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auto-differentiation%2Fxad-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auto-differentiation","download_url":"https://codeload.github.com/auto-differentiation/xad-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auto-differentiation%2Fxad-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: 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":["automatic-differentiation","biotechnology","computer-graphics","derivatives","machine-learning","meteorology","numerical-analysis","optimisation","quant-finance","risk-management","robotics","scientific-computing"],"created_at":"2024-08-13T13:00:19.018Z","updated_at":"2026-01-14T23:44:43.550Z","avatar_url":"https://github.com/auto-differentiation.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":["Risk Analysis","风险分析"],"readme":"[![Python](https://img.shields.io/pypi/pyversions/xad.svg)](https://auto-differentiation.github.io/tutorials/python)\n\n\nXAD is a library designed for\n[automatic differentiation](https://auto-differentiation.github.io/tutorials/aad/),\naimed at both beginners and advanced users. It is intended for use in\nproduction environments, emphasizing performance and ease of use. The library\nfacilitates the computation of derivatives within computer programs, making\nthe process efficient and straightforward for a wide range of mathematical\nfunctions, from simple arithmetic to complex calculations, ensuring accurate\nand automatic derivative computations.\n\nThe Python bindings for XAD offer the following features:\n\n- Support for both forward and adjoint modes at the first order.\n- Strong exception-safety guarantees.\n- High performance, as demonstrated in extensive production use.\n\nFor more details and to integrate XAD into your projects, consult the\ncomprehensive [documentation](https://auto-differentiation.github.io/tutorials/python).\n\n## Application Areas\n\nAutomatic differentiation has many application areas, for example:\n\n-   **Machine Learning and Deep Learning:** Training neural networks or other\n    machine learning models.\n-   **Optimization:** Solving optimization problems in engineering and finance.\n-   **Numerical Analysis:** Enhancing numerical solution methods for\n    differential equations.\n-   **Scientific Computing:** Simulating physical systems and processes.\n-   **Risk Management and Quantitative Finance:** Assessing and hedging risk in\n    financial models.\n-   **Computer Graphics:** Optimizing rendering algorithms.\n-   **Robotics:** Improving control and simulation of robotic systems.\n-   **Meteorology:** Enhancing weather prediction models.\n-   **Biotechnology:** Modeling biological processes and systems.\n\n## Getting Started\n\nInstall:\n\n```text\npip install xad\n```\n\n\nCalculate first-order derivatives in adjoint mode:\n\n```python\nimport xad.adj_1st as xadj\n\n\n# set independent variables\nx0_ad = xadj.Real(1.0)\nx1_ad = xadj.Real(1.5)\nx2_ad = xadj.Real(1.3)\nx3_ad = xadj.Real(1.2)\n\nwith xadj.Tape() as tape:\n    # and register them\n    tape.registerInput(x0_ad)\n    tape.registerInput(x1_ad)\n    tape.registerInput(x2_ad)\n    tape.registerInput(x3_ad)\n\n    # start recording derivatives\n    tape.newRecording()\n\n    # calculate the output\n    y = x0_ad + x1_ad - x2_ad * x3_ad\n\n    # register and seed adjoint of output\n    tape.registerOutput(y)\n    y.derivative = 1.0\n\n    # compute all other adjoints\n    tape.computeAdjoints()\n\n    # output results\n    print(f\"y = {y}\")\n    print(f\"first order derivatives:\\n\")\n    print(f\"dy/dx0 = {x0_ad.derivative}\")\n    print(f\"dy/dx1 = {x1_ad.derivative}\")\n    print(f\"dy/dx2 = {x2_ad.derivative}\")\n    print(f\"dy/dx3 = {x3_ad.derivative}\")\n```\n\nFor more information, see the [Documentation](https://auto-differentiation.github.io/tutorials/python).\n\n## Related Projects\n\n- XAD Comprehensive automatic differentiation in [Python](https://github.com/auto-differentiation/xad-py) and [C++](https://github.com/auto-differentiation/xad)\n- QuantLib-Risks: Fast risk evaluations in [Python](https://github.com/auto-differentiation/QuantLib-Risks-Py) and [C++](https://github.com/auto-differentiation/QuantLib-Risks-Cpp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauto-differentiation%2Fxad-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauto-differentiation%2Fxad-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauto-differentiation%2Fxad-py/lists"}