{"id":18546459,"url":"https://github.com/adroll/lbfgs-d","last_synced_at":"2026-02-24T06:03:15.124Z","repository":{"id":23726347,"uuid":"27099544","full_name":"AdRoll/lbfgs-d","owner":"AdRoll","description":"A native D implementation of Limited Memory Broyden–Fletcher–Goldfarb–Shanno optimizer","archived":false,"fork":false,"pushed_at":"2014-11-24T23:10:44.000Z","size":136,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-02-17T09:33:06.988Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"D","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/AdRoll.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":"2014-11-24T23:09:50.000Z","updated_at":"2024-11-16T09:50:58.000Z","dependencies_parsed_at":"2022-08-22T03:31:12.727Z","dependency_job_id":null,"html_url":"https://github.com/AdRoll/lbfgs-d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AdRoll/lbfgs-d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Flbfgs-d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Flbfgs-d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Flbfgs-d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Flbfgs-d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdRoll","download_url":"https://codeload.github.com/AdRoll/lbfgs-d/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Flbfgs-d/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261080420,"owners_count":23106593,"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":[],"created_at":"2024-11-06T20:25:26.589Z","updated_at":"2025-10-24T01:03:35.388Z","avatar_url":"https://github.com/AdRoll.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LBFGS-D\n\n**LBFGS-D** provides a native implementation of the Limited-Memory Broyden–Fletcher–Goldfarb–Shanno algorithm\n(L-BFGS) in the **D** programming language.\n\nThe implementation is meant to be as simple and readable as possible, as a single self-contained file module.\n\nIt doesn't rely on any third-party dependency and follows closely Nocedal \u0026 Wright's algorithm description provided\nin [Numerical Optimization (2 ed. Springer, 2006)](http://www.springer.com/mathematics/book/978-0-387-30303-1) book.\nIt is particularly well suited for cases where the function \u0026 gradient evaluations are relatively expensive compared\nto the actual quasi-Newton variables updates.\n\nThe API requires you to specify a:\n```D\nvoid delegate(const float[] x, ref float[] resGrad, out float resFunc)\n```\nwhich computes at point `x` the value `resFunc` of the function to minimize,\nas well as its gradient `resGrad` at point `x`.\n\n```D\nimport LBFGS : LBFGS;\nauto d = 30; // 30 dimensions\nauto m = 5; // rank of inv-Hessian approximation\nvoid my_function(const float[] x, ref float[] res_grad, out float res_func)\n{\n  ...\n}\nauto solution = new float[d];\nsolution[] = 0; // specify your starting point here\nfloat min_val;\nauto lbfgs = new LBFGS(d, \u0026my_function, m); // will allocate memory\nlbfgs.solve(solution, min_val); // run optimizer\n```\nAdditionaly, one can specify a Jacobi preconditioner to be used.\n\nMore examples of usage can be found in the module unit-tests:\n```D\nrdmd -main -unittest LBFGS.d\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadroll%2Flbfgs-d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadroll%2Flbfgs-d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadroll%2Flbfgs-d/lists"}