Skip to content

Releases: zfit/zfit

Binned and mixed fits

22 Aug 12:57
Compare
Choose a tag to compare

Public release of binned fits and upgrade to Python 3.10 and TensorFlow 2.9.

While binned fits are now supported, they still lack some stability, public testing and features. Feedback is, as usual, very welcome!

Major Features and Improvements

  • improved data handling in constructors from_pandas (which allows now to
    have weights as columns, dataframes that are a superset of the obs) and
    from_root (obs can now be spaces and therefore cuts can be direcly applied)
  • add hashing of unbinned datasets with a hashint attribute. None if no hash was possible.

Bug fixes and small changes

  • SimpleLoss correctly supports both functions with implicit and explicit parameters, also if they
    are decorated.
  • extended sampling errored for some cases of binned PDFs.
  • ConstantParameter errored when converted to numpy.
  • Simultaneous binned fits could error with different binning due to a missing sum over
    a dimension.
  • improved stability in loss evaluation of constraints and poisson/chi2 loss.
  • reduce gradient evaluation time in errors for many parameters.
  • Speedup Parameter value assignement in fits, which is most notably when the parameter update time is
    comparably large to the fit evaluation time, such as is the case for binned fits with many nuisance
    parameters.
  • fix ipyopt was not pickleable in a fitresult
  • treat parameters sometimes as "stateless", possibly reducing the number of retraces and reducing the
    memory footprint.

Requirement changes

  • nlopt and ipyopt are now optional dependencies.
  • Python 3.10 added
  • TensorFlow ~= 2.9.0 is now required and the corresponding TensorFlow-Probability version ~= 0.17.0

Thanks

  • @YaniBion for discovering the bug in the extended sampling and testing the alpha release
  • @ResStump for reporting the bug with the simultaneous binned fit

0.9.0a2

02 Mar 16:01
Compare
Choose a tag to compare
0.9.0a2 Pre-release
Pre-release

Major Features and Improvements

  • Save results by pickling, unpickling a frozen (FitResult.freeze()) result and using
    zfit.param.set_values(params, result) to set the values of params.

Deprecations

  • the default name of the uncertainty methods hesse and errors depended on
    the method used (such as 'minuit_hesse', 'zfit_errors' etc.) and would be the exact method name.
    New names are now 'hesse' and 'errors', independent of the method used. This reflects better that the
    methods, while internally different, produce the same result.
    To update, use 'hesse' instead of 'minuit_hesse' or 'hesse_np' and 'errors' instead of 'zfit_errors'
    or 'minuit_minos' in order to access the uncertainties in the fitresult.
    Currently, the old names are still available for backwards compatibility.
    If a name was explicitly chosen in the error method, nothing changed.

Bug fixes and small changes

  • KDE datasets are now correctly mirrored around observable space limits
  • multinomial sampling would return wrong results when invoked multiple times in graph mode due to
    a non-dynamic shape. This is fixed and the sampling is now working as expected.
  • increase precision in FitResult string representation and add that the value is rounded

Thanks

  • schmitse for finding and fixing a mirroring bug in the KDEs
  • Sebastian Bysiak for finding a bug in the multinomial sampling

Fix DCB integral

20 Sep 15:23
Compare
Choose a tag to compare

0.8.2 (20 Sep 2021)

Bug fixes and small changes

  • fixed a longstanding bug in the DoubleCB implementation of the integral.
  • remove outdated deprecations

KDEs for large data and numerical integration

14 Sep 08:40
Compare
Choose a tag to compare

Kernel Density Estimation in 1 dimension for large data sets.

Overview on KDEs

Introduction tutorial notebook

Major Features and Improvements

  • allow FitResult to freeze(), making it pickleable. The parameters
    are replaced by their name, the objects such as loss and minimizer as well.

  • improve the numerical integration by adding a one dimensional efficient integrator, testing for the accuracy of
    multidimensional integrals. If there is a sharp peak, this maybe fails to integrate and the number of points
    has to be manually raised

  • add highly performant kernel density estimation (mainly contributed by Marc Steiner)
    in 1 dimension which allow
    for the choice of arbitrary kernels, support
    boundary mirroring of the data and allow for large (millions) of data samples:

    • :class:~zfit.pdf.KDE1DimExact for the normal density estimation
    • :class:~zfit.pdf.KDE1DimGrid using a binning
    • :class:~zfit.pdf.KDE1DimFFT using a binning and FFT
    • :class:~zfit.pdf.KDE1DimISJ using a binning and an algorithm (ISJ) to solve the optimal bandwidth

    For an introduction, see either :ref:sec-kernel-density-estimation or the tutorial :ref:sec-components-model

  • add windows in CI

Breaking changes

  • the numerical integration improved with more sensible values for tolerance. This means however that some fits will
    greatly increase the runtime. To restore the old behavior globally, do
    for each instance pdf.update_integration_options(draws_per_dim=40_000, max_draws=40_000, tol=1)
    This will integrate regardless of the chosen precision and it may be non-optimal.
    However, the precision estimate in the integrator is also not perfect and maybe overestimates the error, so that
    the integration by default takes longer than necessary. Feel free to play around with the parameters and report back.

Bug fixes and small changes

  • Double crystallball: move a minus sign down, vectorize the integral, fix wrong output shape of pdf
  • add a minimal value in the loss to avoid NaNs when taking the log of 0
  • improve feedback when taking the derivative with respect to a parameter that
    a function does not depend on or if the function is purely Python.
  • make parameters deletable, especially it works now to create parameters in a function only
    and no NameAlreadyTakenError will be thrown.

Requirement changes

  • add TensorFlow 2.6 support (now 2.5 and 2.6 are supported)

Thanks

  • Marc Steiner for contributing many new KDE methods!

Python 3.9 and TF 2.5 support

03 Jun 15:12
Compare
Choose a tag to compare

Major Features and Improvements

  • add Python 3.9 support
  • upgrade to TensorFlow 2.5

Bug fixes and small changes

  • Scipy minimizers with hessian arguments use now BFGS as default

Requirement changes

  • remove Python 3.6 support

minor dependency fix

13 May 00:22
Compare
Choose a tag to compare

Update ipyopt requirement < 0.12 to allow numpy compatible with TensorFlow

small fix in signature and ipyopt dependency

04 May 19:12
Compare
Choose a tag to compare
  • fix for wrong argument in exponential PDF
  • removed requirement ipyopt, can be installed with pip install zfit[ipyopt]
    or by manually installing pip install ipyopt

Minor bug fixes

15 Apr 10:30
Compare
Choose a tag to compare

Minor fixes

  • fix loss failed for large datasets
  • catch hesse failing for iminuit

Minor loss fixes

09 Apr 16:42
Compare
Choose a tag to compare

Minor small fixes.

Bug fixes and small changes

  • add loss to callback signature that gives full access to the model
  • add create_new method to losses in order to re-instantiate
    a loss with new models and data
    preserving their current (and future) options and other arguments

Cleaned up minimizer

31 Mar 17:33
Compare
Choose a tag to compare

Small release to clean up the minimizers and remove non-functioning ones.