Repository navigation
PyBADS 1.1.0
Changes since PyBADS 1.0.6.
Upgrading from 1.0.6
What can stop an existing script, or change what it returns. Each point has
its entry below.
- PyBADS needs Python 3.10 or later and gpyreg 1.3.3 or later.
- Results differ from 1.0.6, also with a fixed seed.
random_seedno longer seeds NumPy's global random state.- The seed is read when the
BADSobject is created: arandom_seedset in
optionsafterwards, ornp.random.seedcalled between creation and
optimize(), does not fix a run. random_seedrefuses a float that is not a whole number, and a string,
with aTypeError.
Added
- Seeded runs through a random generator. Every random draw of a run
comes from onenumpy.random.Generator,bads.rng, whichBADScreates
from therandom_seedoption when the object is created.random_seed
takes whatnumpy.random.default_rngtakes, such as an integer or a
SeedSequence, or aGenerator, whichBADSuses as given; a float that
is a whole number is converted to an integer, and another float, or a
string, raises aTypeError. A seeded run neither reads nor writes NumPy's
global random state, so on one machine two runs with the same seed give
the same result whatever else draws from that state. With
random_seed=None, the default, the generator is derived from NumPy's
global random state when theBADSobject is created, so
np.random.seed(...)before that fixes a run. The draws, and so the
results, differ from those of 1.0.6, also with the same seed.random_seeddoes not seed the target: a target that draws random
numbers of its own, for example fromnp.random, has to be seeded
separately. In 1.0.6 every draw came from NumPy's global random state,
whichrandom_seedseeded, the target's included.- In 1.0.6,
optimize()reseeded NumPy's global random state from the
option, so arandom_seedset inoptionsafter creating theBADS
object, ornp.random.seed(...)called beforeoptimize()with
random_seed=None, fixed a run; neither does. optimize_result["random_seed"]holds the seed when it is an integer
(or a float converted to one), andNoneotherwise.
Changed
- Requirements. PyBADS needs Python 3.10 or later (Python 3.9 has
reached its end of life) and gpyreg 1.3.3 or later, the gpyreg release its
tests run against. From gpyreg 1.3.2 on, the predictions of a GP with very
small noise are more accurate. BADS's GP reaches that regime on many
deterministic targets; on several benchmark problems runs then end closer
to the minimum, some by orders of magnitude, and on the others the results
change little. - Test dependencies. PyBADS no longer lists pytest, pytest-mock and
pytest-rerunfailures among its dependencies.pip install "pybads[test]"
installs what its test suite needs. (gpyreg 1.3.3 itself still installs
pytest and pytest-rerunfailures.)
Fixed
- Repeated evaluations with user-specified noise. With
specify_target_noise=True, a run could stop withValueError: setting an array element with a sequenceafter the optimizer evaluated a point a
second time. The run now continues, with the two observations merged.