{"id":35803279,"url":"https://github.com/yuemingl/math_with_pytorch","last_synced_at":"2026-01-07T12:00:51.127Z","repository":{"id":319617175,"uuid":"1079140694","full_name":"yuemingl/math_with_pytorch","owner":"yuemingl","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-19T07:30:37.000Z","size":98,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-19T18:57:52.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/yuemingl.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-19T07:28:08.000Z","updated_at":"2025-10-19T07:30:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9010b7a-e416-42c4-b1d8-f04896d13680","html_url":"https://github.com/yuemingl/math_with_pytorch","commit_stats":null,"previous_names":["yuemingl/math_with_pytorch"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/yuemingl/math_with_pytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuemingl%2Fmath_with_pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuemingl%2Fmath_with_pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuemingl%2Fmath_with_pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuemingl%2Fmath_with_pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuemingl","download_url":"https://codeload.github.com/yuemingl/math_with_pytorch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuemingl%2Fmath_with_pytorch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28235224,"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","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-01-07T12:00:21.962Z","updated_at":"2026-01-07T12:00:51.110Z","avatar_url":"https://github.com/yuemingl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyTorch Newton's Method Implementations\n\nThis repository contains implementations of Newton's method using PyTorch for both single-variable and multi-variable optimization problems.\n\n## Files\n\n1. `newton.py` - Implementation of Newton's method for single-variable functions\n2. `newton_multivariable.py` - Implementation of Newton's method for multi-variable systems of equations\n3. `loss_backword.py` - Example using PyTorch's autograd for gradient computation\n\n## Newton's Method for Multi-variable Systems\n\nThe `newton_multivariable.py` file implements Newton's method to find the intersection of:\n- A circle: x₁² + x₂² = 4\n- A parabola: x₁ = x₂²\n\nThe implementation provides two solution approaches:\n1. Using `torch.linalg.solve` to solve the linear system J * dx = y\n2. Using matrix inversion with `torch.linalg.inv` to compute x_new = x - J⁻¹y\n\nKey features:\n- Automatic differentiation with `torch.autograd.functional.jacobian`\n- Custom implementation of the Jacobian matrix\n- Convergence checking with tolerance\n- Maximum iteration limit\n\n## Requirements\n\n- Python 3.x\n- PyTorch\n\n## Usage\n\nTo run the multi-variable Newton's method:\n```bash\npython newton_multivariable.py\n```\n\nThe implementation will find the intersection points of the circle and parabola, demonstrating the convergence of Newton's method for systems of nonlinear equations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuemingl%2Fmath_with_pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuemingl%2Fmath_with_pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuemingl%2Fmath_with_pytorch/lists"}