Changelog#
All notable changes to this project will be documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
v0.7.0 - 2024-11-11#
Additions
Add the hyperparameter tuning scaling results from tuning ResNet18 for ImageNet via random search.
Add the data itself:
data/resnet/resnet18_scaling.results.jsonl
.Add a license for the data:
data/resnet/LICENSE
.Add a README for the data:
data/resnet/README.md
.
Add support for
scipy == 1.14
andnumpy == 2.1
.Add the
C_MIN
andC_MAX
class attributes toopda.parametric.QuadraticDistribution
andopda.parametric.NoisyQuadraticDistribution
.Add
opda.utils.normal_ppf
, a fast function for computing the standard normal’s PPF (quantile function).Check that
c
is finite when validating the arguments toopda.parametric.QuadraticDistribution
andopda.parametric.NoisyQuadraticDistribution
.Add
fit
methods to the parametric distributions:opda.parametric.QuadraticDistribution.fit
andopda.parametric.NoisyQuadraticDistribution.fit
.Add support for Python 3.13.
Changes
Simplify the implementation of
opda.parametric.NoisyQuadraticDistribution
by makingscale
the standard deviation of the corresponding normal random variable.Upgrade packaging tools to
build == 1.2.1
andtwine == 5.1.1
.Skip some tests for
opda.utils.beta_equal_tailed_interval
,opda.utils.beta_highest_density_interval
, andopda.utils.beta_equal_tailed_coverage
when they fail due to an issue inscipy == 1.14.0
on Linux that causes spurious NaN values.Use the point mass, noiseless, and normal approximations to speed up the
ppf
method ofopda.parametric.NoisyQuadraticDistribution
.Disable lint rules:
B023
: “Function definition does not bind loop variable {name}”.PLW2901
: “Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target”.SIM102
: “Use a singleif
statement instead of nestedif
statements”.
Restrict the range of values for
c
supported byopda.parametric.QuadraticDistribution
to1
to10
.
Removals
Drop support for
numpy == 1.21
,numpy == 1.22
,scipy == 1.8
, andscipy == 1.9
.Remove the
estimate_initial_parameters_and_bounds
method fromopda.parametric.QuadraticDistribution
.
Fixes
Update tests for the
__repr__
methods ofopda.nonparametric.EmpiricalDistribution
,opda.parametric.QuadraticDistribution
, andopda.parametric.NoisyQuadraticDistribution
so that they’re compatible withnumpy == 2.0
.Fix flakiness in the test:
NoisyQuadraticDistributionTestCase.test_ppf_is_inverse_of_cdf
.Fix the
quantile_tuning_curve
methods ofopda.parametric.QuadraticDistribution
andopda.parametric.NoisyQuadratricDistribution
which gave incorrect output whenq
wasn’t equal to0.5
and eitherminimize
wasTrue
orminimize
wasNone
andconvex
wasTrue
.
Documentation
Correct the quantile function’s definition in the docstrings for the
ppf
methods ofopda.parametric.QuadraticDistribution
andopda.parametric.NoisyQuadraticDistribution
.Make docstring formatting more consistent:
Always use “Returns” and never “Return” for the docstring section header.
Always document optional types with “or None” coming at the end of the type description.
Always document each returned value with a separate subheading when a function or method returns multiple values.
Remove default values from parameters’ type descriptions.
v0.6.1 - 2024-04-03#
Additions
Add support for
numpy == 2.0
andscipy == 1.13
.
Changes
Disable lint rule
PLR1714
: “Consider merging multiple comparisons”.
Documentation
Split the Jupyter notebook Evaluating DeBERTaV3 with the Nonparametric Analysis into several smaller more focused notebooks:
Evaluating DeBERTaV3 with the Nonparametric Analysis
Choosing a Sample Size for the Nonparametric Analysis
Demonstrating the Exact Coverage of the Nonparametric Analysis
Studying Ablations of the Nonparametric Analysis
Add a section about how to analyze a hyperparameter (the number of epochs) to the Jupyter notebook Evaluating DeBERTaV3 with the Nonparametric Analysis.
In the Examples doc (
docs/tutorial/examples.rst
), improve the code, wording, and title of the model comparison example (previously titled Compare Models’ Tuning Curves, now titled Compare Models).In the Examples doc (
docs/tutorial/examples.rst
), expand the Compare Models example with discussion on how to compare models with different training costs.Fix incorrect markup in the Examples doc (
docs/tutorial/examples.rst
).Add a new example showing how to analyze a hyperparameter in the Examples doc (
docs/tutorial/examples.rst
).Add plots of DeBERTa and DeBERTaV3’s tuning curves with confidence bands using large sample sizes (1,024) to the Jupyter notebook Evaluating DeBERTaV3 with the Nonparametric Analysis.
v0.6.0 - 2024-03-04#
Additions
Add
opda.approximation
, a module for approximation-theoretic operations, with the following functions:opda.approximation.lagrange_interpolate
: Interpolate points with a polynomial.opda.approximation.remez
: Identify the reference corresponding to the minimax polynomial approximation of a function.opda.approximation.minimax_polynomial_approximation
: Evaluate the minimax polynomial approximation of a function.opda.approximation.minimax_polynomial_coefficients
: Compute the coefficients of the minimax polynomial approximation of a function.opda.approximation.piecewise_polynomial_knots
: Find the knots for the minimax piecewise polynomial approximation of a function.
Add
opda.exceptions.NumericalError
, an exception for numerical issues.Add more tests for
opda.parametric.QuadraticDistribution
.Add
mean
andvariance
attributes toopda.nonparametric.EmpiricalDistribution
.Add
mean
andvariance
attributes toopda.parametric.QuadraticDistribution
.Add
opda.utils.normal_pdf
, a fast function for computing the standard normal’s PDF.Add
opda.utils.normal_cdf
, a fast function for computing the standard normal’s CDF.Add
opda.exceptions.IntegrationError
, an exception for integration issues.Add
opda.parametric.NoisyQuadraticDistribution
, a probability distribution representing a quadratic random variable plus normal noise.Increase argument validation in
opda.utils.dkw_epsilon
.Add more test cases for
opda.utils.dkw_epsilon
.Validate that
lightness
is between 0 and 1 (inclusive) inexperiments.visualization.color_with_lightness
.Validate that arguments are finite floats where appropriate.
Changes
Reparametrize
parametric.QuadraticDistribution
soc
is the effective number of hyperparameters instead of half the number.Completely disable the eradicate (
ERA
) lint rules.Enable
"py"
as the primary domain in the documentation.Always use numpy’s numeric types for scalar class attributes, instead of Python’s native numeric types.
Improve tests for
parametric.QuadraticDistribution
, making them more thorough, robust, and avoiding re-running redundant test cases.Update the tests for
parametric.QuadraticDistribution
to cover the case whena == b
.Move the source repository from
github.com/nalourie/opda
togithub.com/nicholaslourie/opda
, and move the docs fromnalourie.github.io/opda
tonicholaslourie.github.io/opda
. Update the project URLs inpyproject.toml
and all the links throughout the repository to reflect these changes.Require
fraction
is greater than 0 inopda.parametric.QuadraticDistribution.estimate_initial_parameters_and_bounds
.Throw an error if
fraction
is too small and thus causesopda.parametric.QuadraticDistribution.estimate_initial_parameters_and_bounds
to try and form an estimate from an empty list.
Fixes
Fix
parametric.QuadraticDistribution
(the.pdf
,.cdf
, and.estimate_initial_parameters_and_bounds
methods) for the case whena == b
, in which case the distribution is an atom (point mass).Fix
opda.parametric.QuadraticDistribution.estimate_initial_parameters_and_bounds
whenconvex
isFalse
andfraction
is small enough so that the estimate should be based on an empty list. In this case, the method incorrectly uses all ofys
. Instead, throw an error saying that fraction is too small (as it produces an empty list).Avoid throwing an unnecessary warning in
opda.utils.dkw_epsilon
whenconfidence
is 1.
Documentation
Improve the docstring for
experiments.analytic.get_approximation_parameters
.Use inline math markup in docstrings.
Fix the equation in the docstring for
opda.parametric.QuadraticDistribution.ppf
. The infimum that defines the quantile function has as its domain the interval froma
tob
, not the entire real line.Add “See Also” and “Notes” sections to the docstring for
opda.parametric.QuadraticDistribution
, matching the newly added docstring foropda.parametric.NoisyQuadraticDistribution
.Update all links to use
github.com/nicholaslourie
andnicholaslourie.github.io/opda
in place ofgithub.com/nalourie
andnalourie.github.io/opda
.Document stricter dependent type constraints (e.g., non-negativity, finiteness) for function and method inputs and outputs.
Document range constraints for inputs and outputs more precisely and consistently (e.g.,
q
is a float from 0 to 1 inclusive).Improve the docstring for
experiments.analytic.ellipse_volume
.Fix docstrings across the code base in order to consistently document when a value can take on either scalar (e.g., float) or array (e.g., array of floats) values.
v0.5.0 - 2024-01-15#
This version is the first uploaded to PyPI and available via pip
!
Additions
Add a continuous integration job to ensure every pull request updates the changelog.
In the continuous integration job for building the packages, add a step to list the packages’ contents.
Add the “release” nox session for making new releases to PyPI.
Changes
Upgrade the development dependencies.
Upgrade the
Development Status
PyPI classifier for opda from3 - Alpha
to4 - Beta
.
Fixes
Fix flakiness in the test:
EmpiricalDistributionTestCase.test_average_tuning_curve
.
Documentation
Pin links to the source on GitHub to the commit that builds the documentation.
Move development documentation into the “Contributing” section of the sidebar and URL tree.
Omit from the documentation’s sidebar any project URLs that link to the documentation.
Add an announcement banner to the documentation when it’s built for an unreleased version.
Add a changelog (
CHANGELOG.rst
).Document the project’s various conventions in the development docs.
Add the “Release” doc describing the release process.
Update the docs to suggest installing opda from PyPI rather than the source for regular usage.
v0.4.0 - 2024-01-10#
Additions
Add the
package
optional dependencies.Add a build for “distribution” as opposed to “local” use. The distribution package contains only the
opda
library and notexperiments
.Add a
nox
session for building the distribution package.Add a continuous integration job to build the package and store it as an artifact on each pull request.
Add a continuous integration job to test the distribution package against all combinations of supported versions of major dependencies.
Changes
Increase retention for documentation build artifacts from 60 to 90 days in continuous integration.
Prune each set of optional dependencies.
Rename the
tests
optional dependencies totest
.Split the
test
session innox
intotest
, for testing the local project, andtestpackage
, for testing distribution packages.In continuous integration, only test the local build against default versions of major dependencies, since we now build and test the distribution package against all combinations of supported versions.
Documentation
Document how to build and test the distribution package.
v0.3.0 - 2024-01-07#
Additions
Extend
nonparametric.QuadraticDistribution.sample
andnonparametric.EmpiricalDistribution.sample
to return a scalar whensize=None
, and make it the default argument.Add documentation builds via Sphinx:
Create a Sphinx setup for building the documentation.
Add tutorial-style documentation for users.
Add development documentation.
Automatically generate API reference documentation.
Add a GitHub Actions workflow for building and publishing the documentation to GitHub Pages.
Make tests backwards compatible with
numpy >= 1.21
.Adjust package dependency requirements to allow
numpy >= 1.21
andscipy >= 1.8
.Add
ci
optional dependencies for continuous integration.Add
nox
for automating development tasks, testing against all supported major dependencies, and continuous integration.Add a GitHub Actions workflow for continuous integration. Run it on each pull request as well as every calendar quarter. Use the workflow to:
Check
opda
’s major dependency versions are up-to-date.Lint the project.
Build and test the documentation.
Test the project against all combinations of supported versions of major dependencies.
Changes
Always return scalars rather than 0 dimensional arrays from methods (
nonparametric.EmpiricalDistribution.pmf
andparametric.QuadraticDistribution.pdf
).Explicitly test that all methods of
nonparametric.EmpiricalDistribution
andparametric.QuadraticDistribution
return scalars rather than 0D arrays.Configure
pytest
to always use a non-interactive backend formatplotlib
.Update the project URLs in packaging.
Split out the
experiments
package’s dependencies as optional dependencies.
Fixes
Include
src/experiments/default.mplstyle
in the package data for the experiments package so the style can be used from non-editable installs.Make tests more robust to changes in rounding errors across environments by replacing some equality checks with near equality.
Documentation
Remove broken references to the sections of numpy-style docstrings. Standard tooling doesn’t make these sections linkable.
Fix errors in the docstrings’ markup.
Use cross-references in the docs wherever possible and appropriate.
Use proper markup for citations.
Change the language from
bash
toconsole
in code blocks.Improve the modules’ docstrings.
Rewrite
README.rst
, adding a “Quickstart” section and moving much of the old content into new tutorial-style documentation built with Sphinx.Document how to build and test the documentation.
Document how to setup and use
nox
for common development tasks.
v0.2.0 - 2023-12-16#
Additions
Add backwards compatibility for Python 3.8.
Add
pyproject.toml
for building the project, replacing thesetup.py
based build.Add and increase argument validation in functions and methods.
Add the
--all-levels
pytest flag for running all tests.Add new tests for
nonparametric.EmpiricalDistribution
andparametric.QuadraticDistribution
.Give all tuning curve methods a new parameter,
minimize
, for computing minimizing hyperparameter tuning curves.nonparametric.EmpiricalDistribution
methods:quantile_tuning_curve
,average_tuning_curve
,naive_tuning_curve
,v_tuning_curve
, andu_tuning_curve
.parametric.QuadraticDistribution
methods:quantile_tuning_curve
, andaverage_tuning_curve
.
Add
__repr__
,__str__
, and__eq__
methods tononparamatric.EmpiricalDistribution
andparametric.QuadraticDistribution
.Add a
generator
parameter to set the random seed in functions and methods using randomness (experiments.simulation.Simulation.run
,experiments.visualization.plot_random_search
,nonparametric.EmpiricalDistribution.confidence_bands
,nonparametric.EmpiricalDistribution.sample
, andparametric.QuadraticDistribution.sample
).Add the
opda.random
module to migrate off of numpy’s legacy API for random numbers while still enabling control ofopda
’s global random state viaopda.random.set_seed
.Add the
RandomTestCase
class for making tests using randomness reproducible.Configure
ruff
for linting the project.
Changes
Require
pytest >= 6
for running tests.Configure
pytest
to use thetests/
test path.Use
Private :: Do Not Upload
classifier to prevent the package from being uploaded to PyPI.Speed up coverage tests for
nonparametric.EmpiricalDistribution.confidence_bands
.Rename optional dependencies from
dev
totests
.Standardize the error messages for violating argument type constraints.
Expand existing tests to cover more cases for
EmpiricalDistribution
andQuadraticDistribution
.Rename
exceptions.OptimizationException
toexceptions.OptimizationError
.Use
TypeError
in place ofValueError
for type errors.Across all functions and methods, standardize which parameters are keyword-only. Reserve keyword-only status for rarely used arguments, such as implementation details like optimization tolerances.
Disallow
None
as an argument for thea
andb
parameters ofnonparametric.EmpiricalDistribution
.
Fixes
Fix flakiness in various tests.
Ensure
utils.beta_highest_density_interval
always returns an interval containing the mode, even for very small intervals.Fix bug in
nonparametric.EmpiricalDistribution.confidence_bands
that caused coverage to be too high, especially given small samples.Improve coverage tests for
nonparametric.EmpiricalDistribution.confidence_bands
so that they’re more sensitive and explicitly test small sample sizes.Prevent warnings during expected use of various methods of
QuadraticDistribution
.Suppress expected warnings in tests.
Fix
parametric.QuadraticDistribution.quantile_tuning_curve
which would throw an exception when the instance hadconvex=True
.Fix tests for
parametric.QuadraticDistribution
so that they actually check all intended cases.
Removals
Remove the
setup.py
based build and associated files (setup.py
,setup.cfg
,MANIFEST.in
, andrequirements.txt
), replacing it withpyproject.toml
.
Documentation
Add sections and improve markup in
README.rst
.Add links to and citations for Show Your Work with Confidence.
Add sections, update content, and improve markup in existing docstrings.
Document development tools for the project.
Begin running doctests on all documentation.
Document how to run doctests in
README.rst
.Set the random seed in documentation examples to make them testable.
Fix errors in examples discovered via doctests.
Document
pip
version requirements for editable installs inREADME.rst
.Document type constraints (e.g., non-negative integers as opposed to integers) in functions and methods’ docstrings.
Document the
atol
parameter ofutils.beta_highest_density_interval
andutils.highest_density_coverage
.
v0.1.0 - 2023-11-14#
Additions
Initial release.