{"id":17872746,"url":"https://github.com/jfdev001/gradient-ascent-and-simulated-annealing","last_synced_at":"2025-04-02T23:41:08.558Z","repository":{"id":98561868,"uuid":"428336436","full_name":"jfdev001/gradient-ascent-and-simulated-annealing","owner":"jfdev001","description":"Gradient ascent and simulated annealing optimization algorithms for multivariate Gaussian space from scratch.","archived":false,"fork":false,"pushed_at":"2021-11-15T16:20:37.000Z","size":3281,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T13:45:35.984Z","etag":null,"topics":["gradient-ascent","python","simulated-annealing"],"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/jfdev001.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":"2021-11-15T16:18:28.000Z","updated_at":"2021-11-15T16:20:40.000Z","dependencies_parsed_at":"2023-03-13T15:58:46.976Z","dependency_job_id":null,"html_url":"https://github.com/jfdev001/gradient-ascent-and-simulated-annealing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfdev001%2Fgradient-ascent-and-simulated-annealing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfdev001%2Fgradient-ascent-and-simulated-annealing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfdev001%2Fgradient-ascent-and-simulated-annealing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfdev001%2Fgradient-ascent-and-simulated-annealing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfdev001","download_url":"https://codeload.github.com/jfdev001/gradient-ascent-and-simulated-annealing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246911496,"owners_count":20853654,"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":["gradient-ascent","python","simulated-annealing"],"created_at":"2024-10-28T10:46:05.822Z","updated_at":"2025-04-02T23:41:08.542Z","avatar_url":"https://github.com/jfdev001.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gradient Ascent and Simulated Annealing for Multivariate Gaussian\n\nImplementation of and comparison for [Hill Climbing (aka Gradient Ascent, aka greedy best first search)](https://en.wikipedia.org/wiki/Hill_climbing) and [Simulated Annealing](https://en.wikipedia.org/wiki/Simulated_annealing) on a known function space modeled by a [multivariate Gaussian distribution](https://en.wikipedia.org/wiki/Multivariate_normal_distribution).\n\nFor a summary of results, see `reoprt/report.pdf`.\n\n# Installation\n\nThis repository makes use of Python's scientific computing/data analysis libraries NumPy and Pandas.\n\n`pip install numpy pandas`\n\n# Testing\n\nBoth simulated annealing and hill climbing can be tested on the generated multivariate gaussian space. Both algorithms make use of a command line interface which is available as a function named `cli` in `greedy.py`.\n\nThe input for both scripts can be shown using `python greedy.py -h` or `python sa.py -h`.\n\n```\npositional arguments:\n  seed                  random number seed. (default: 0)\n  d_dimensions          number of dimensions for exploration space. (default: 3)\n  n_gaussians           number of gaussians. (default: 1)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --iter_threshold ITER_THRESHOLD\n                        max number of iterations before termination. (default: 100000)\n\nlogging:\n  params for logging outputs.\n\n  --print_last_only {True,False}\n                        true to log optimization output at last step and iterations, false to log position only at all steps. (default: False)\n\ngreedy:\n  params for greedy local search only.\n\n  --step_size STEP_SIZE\n                        step size for gradient ascent. (default: 0.01)\n```\n\n# Analysis\n\nAfter running `sa.py` and `greedy.py` with the same arguments related to the Gaussian space (`seed `, `d_dimensions `, `n_gaussians`), the last two arguments being in combos.txt, `process.py` can be run to compare the performance of the algorithms.\n\n# Future Work\n\nArbitrary function spaces and numerical differentiation might be implemented to avoid strictly traversing the multivariate Gaussian space.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfdev001%2Fgradient-ascent-and-simulated-annealing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfdev001%2Fgradient-ascent-and-simulated-annealing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfdev001%2Fgradient-ascent-and-simulated-annealing/lists"}