{"id":18014849,"url":"https://github.com/zevv/nimcmaes","last_synced_at":"2025-10-06T10:10:46.918Z","repository":{"id":150599206,"uuid":"274993085","full_name":"zevv/nimcmaes","owner":"zevv","description":"Nim CMA-ES library","archived":false,"fork":false,"pushed_at":"2020-06-26T19:03:50.000Z","size":778,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-04T11:46:20.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/zevv.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":"2020-06-25T18:57:56.000Z","updated_at":"2025-07-13T15:03:42.000Z","dependencies_parsed_at":"2023-06-11T17:15:43.111Z","dependency_job_id":null,"html_url":"https://github.com/zevv/nimcmaes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zevv/nimcmaes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimcmaes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimcmaes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimcmaes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimcmaes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zevv","download_url":"https://codeload.github.com/zevv/nimcmaes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimcmaes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278591306,"owners_count":26012034,"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":"2025-10-06T02:00:05.630Z","response_time":65,"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":"2024-10-30T04:11:23.479Z","updated_at":"2025-10-06T10:10:46.894Z","avatar_url":"https://github.com/zevv.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nThis is a minimal Nim binding for the C-CMA-ES library\n\n\u003e \"_The CMA-ES (Covariance Matrix Adaptation Evolution Strategy) is an\n  evolutionary algorithm for difficult non-linear non-convex black-box\n  optimisation problems in continuous domain. It is considered as\n  state-of-the-art in evolutionary computation and has been adopted as one of the\n  standard tools for continuous optimisation in many (probably hundreds of)\n  research labs and industrial environments around the world._\"\n\n![CMA-ES](/doc/cmaes.gif)\n\n- http://cma.gforge.inria.fr/cmaesintro.html\n- http://cma.gforge.inria.fr/cmaes_sourcecode_page.html\n- https://github.com/cma-es/c-cmaes\n\n## Introduction\n\nThe CMA-ES algorithm can be used to find solutions to any N-dimensional\noptimization problem.\n\nIn practical terms:\n\n- The user provides a fitness function which calculates the error output for a\n  given problem with N continuous inputs\n\n- The CMA-ES algorithm makes up values for the inputs, calls the fit function\n  and inspects the returned error\n\n- The input variables are adjusted depending on the error value\n\n- Step 2 and 3 are repeated until the algorithm finds the best solution\n  matching your error function\n\n\nFor now this library offers only the bare minimum functionality of the\nunderlying C library. Also, I do not actually understand any of the\nimplementation, I just use this library to solve real-world problems.\n\n\n## Example\n\n```nim\nimport nimcmaes\nimport math\n\n# This is the fit function: It is passed an number of floats which have some\n# meaning for the problem you are trying to solve. This function should\n# calculate the error for a target from the inputs for your problem. The closer\n# to 0, the better the input values.\n\nproc fitFun(v: openArray[float]): float =\n\n  # Rosenbrock function\n\n  let (x, y) = (v[0], v[1])\n  result = pow(1.0 - x, 2) + 100.0 * pow(y - x * x, 2)\n\n\n\n# Run the CMAES algorithm\n\nlet\n  start  = [0.0, 0.0]  # These are the start values\n  stddev = [1.0, 1.0]  # And the expected standard deviation\n\nlet xbest = cmaesRun(start, stddev, fitFun)\necho xbest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fnimcmaes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzevv%2Fnimcmaes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fnimcmaes/lists"}