{"id":28452697,"url":"https://github.com/juliasmoothoptimizers/multiprecisionr2","last_synced_at":"2026-01-28T12:34:52.143Z","repository":{"id":180155023,"uuid":"627932785","full_name":"JuliaSmoothOptimizers/MultiPrecisionR2","owner":"JuliaSmoothOptimizers","description":"Mutli-Precision extension of Quadratic Regularization (R2) optimization algorithm to finite precision computations.","archived":false,"fork":false,"pushed_at":"2023-12-17T19:13:31.000Z","size":977,"stargazers_count":1,"open_issues_count":16,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-05T02:33:36.663Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaSmoothOptimizers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-14T14:17:01.000Z","updated_at":"2023-11-14T20:00:09.000Z","dependencies_parsed_at":"2023-11-13T10:31:13.493Z","dependency_job_id":"df998b65-afc6-4a07-b02c-2f1c6ad671ca","html_url":"https://github.com/JuliaSmoothOptimizers/MultiPrecisionR2","commit_stats":null,"previous_names":["d-monnet/multiprecisionr2"],"tags_count":0,"template":false,"template_full_name":"JuliaSmoothOptimizers/JSOTemplate.jl","purl":"pkg:github/JuliaSmoothOptimizers/MultiPrecisionR2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FMultiPrecisionR2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FMultiPrecisionR2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FMultiPrecisionR2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FMultiPrecisionR2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaSmoothOptimizers","download_url":"https://codeload.github.com/JuliaSmoothOptimizers/MultiPrecisionR2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaSmoothOptimizers%2FMultiPrecisionR2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28816581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"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":[],"created_at":"2025-06-06T18:12:25.109Z","updated_at":"2026-01-28T12:34:52.138Z","avatar_url":"https://github.com/JuliaSmoothOptimizers.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MultiPrecisionR2 #\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaSmoothOptimizers.github.io/MultiPrecisionR2/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaSmoothOptimizers.github.io/MultiPrecisionR2/dev)\n[![Build Status](https://github.com/JuliaSmoothOptimizers/MultiPrecisionR2/workflows/CI/badge.svg)](https://github.com/JuliaSmoothOptimizers/MultiPrecisionR2/actions)\n[![Build Status](https://api.cirrus-ci.com/github/JuliaSmoothOptimizers/MultiPrecisionR2.svg)](https://cirrus-ci.com/github/JuliaSmoothOptimizers/MultiPrecisionR2)\n[![Coverage](https://codecov.io/gh/JuliaSmoothOptimizers/MultiPrecisionR2/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaSmoothOptimizers/MultiPrecisionR2)\n\n`MultiPrecisionR2.jl` is a package that implements a multi-precision version of the Quadratic Regularization (R2) algorithm, a first-order algorithm, for solving non-convex, continuous, smooth optimization problems. The Floating Point (FP) format is adapted dynamically during algorithm execution to use low precision FP formats as much as possible while ensuring convergence and numerical stability.\n\nThe package also implements multi-precision models `FPMPNLPModel` structure that derives from `NLPModel` implemented in [NLPModels.jl](https://github.com/JuliaSmoothOptimizers/NLPModels.jl). The interfaces for objective and gradient evaluations are extended to provide evaluation errors.\n\n`MultiPrecisionR2` can ensure numerical stability by using interval evaluations of the objective function and gradient. Interval evaluation relies on [IntervalArithmetic.jl](https://github.com/JuliaIntervals/IntervalArithmetic.jl/blob/master/README.md) package to perform the interval evaluations.\n\n## Installation\n```julia\nusing Pkg\nPkg.add(\"MultiPrecisionR2\")\n```\n## Minimal examples\n```@example\nusing MultiPrecisionR2\n\nFP = [Float16,Float32] # define floating point formats used by the algorithm for objective and gradient evaluation\nf(x) = x[1]^2 + x[2]^2 # some objective function\nx0 = ones(Float32,2) # initial point\nmpmodel = FPMPNLPModel(f,x0,FP); # instanciate a Floating Point Multi Precision NLPModel (FPMPNLPModel)\nstat = MPR2(mpmodel) # run the algorithm\n```\n\n```@example\nusing MultiPrecisionR2\nusing ADNLPModels\nusing OptimizationProblems\nusing OptimizationProblems.ADNLPProblems\n\nFP = [Float16,Float32] # define floating point formats used by the algorithm for objective and gradient evaluation\ns = :woods # select problem\nnlp = eval(s)(n=12,type = Val(FP[end]), backend = :generic)\nmpmodel = FPMPNLPModel(nlp,FP); # instanciate a Floating Point Multi Precision NLPModel (FPMPNLPModel)\nstat = MPR2(mpmodel) # run the algorithm\n```\n\n## Warnings\n1. MultiPrecisionR2 is designed to work with FP formats. Other format, such as fix point, might break the convergence property of the algorithm.\n2. * Interval evaluation might fail with rounding mode other than `:accurate` for FP formats other than `Float32` and `Float64`. When using interval evaluation, it is recommended to call \n```julia\nusing IntervalArithmetic\nsetrounding(Interval,:accurate)\n``` \nbefore instanciating a `FPMPNLPModel`.\n\n3. If interval evaluation mode is used, interval evaluations of the objective and the gradient are automatically tested upon `FPMPNLPModel` instantiation.  An error is thrown if the evaluation fails. This might happen for several reasons related to [IntervalArithmetic.jl](https://github.com/JuliaIntervals/IntervalArithmetic.jl/blob/master/README.md) package.\n\n\n## Bug reports and discussions\n\nIf you think you found a bug, feel free to open an [issue](https://github.com/JuliaSmoothOptimizers/MultiPrecisionR2/issues).\nFocused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.\n\nIf you want to ask a question not suited for a bug report, feel free to start a discussion [here](https://github.com/JuliaSmoothOptimizers/Organization/discussions). This forum is for general discussion about this repository and the [JuliaSmoothOptimizers](https://github.com/JuliaSmoothOptimizers) organization, so questions about any of our packages are welcome.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliasmoothoptimizers%2Fmultiprecisionr2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliasmoothoptimizers%2Fmultiprecisionr2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliasmoothoptimizers%2Fmultiprecisionr2/lists"}