Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add: class SignificantFigure(Int):
Rounds data to a specified number of significant figures.
Types of changes
Motivation and Context / Related issue
Why is this change required?
This change introduces the SignificantFigure layer into the Nevergrad optimization library, addressing a specific need for precise control over the numerical precision of parameters during the optimization process. The current version of Nevergrad does not offer an in-built method to enforce a specific number of significant figures in its parametrization process. This limitation can lead to challenges in scenarios where the precision of parameters, defined by the number of significant digits, is crucial, such as in scientific computations, financial models, or engineering simulations.
What problem does it solve?
The SignificantFigure layer solves the problem of rounding parameter values to a defined number of significant figures. This is particularly useful when working with parameters that can vary over wide ranges, where the precision in terms of decimal places may not be consistent across different magnitudes. The introduction of this layer ensures that the parameters are handled consistently, irrespective of their scale, enhancing the robustness and accuracy of the optimization results.
Furthermore, this change enables Nevergrad users to more closely align the optimization process with domain-specific requirements regarding numerical precision, thereby expanding the library's applicability and utility in various technical and scientific fields.
How Has This Been Tested (if it applies)
tested localy
Checklist
if this functionality is needed in nevergrad, I will complete all the necessary items required for merge (nevergrad/contributing.html)