Published May 10, 2022 | Version v1
Dataset Open

Research data and example scripts for the paper "Bayesian Target-Vector Optimization for Efficient Parameter Reconstruction"

  • 1. Zuse Institut Berlin
  • 2. Physikalisch Technische Bundesanstalt
  • 3. ROR icon Zuse Institute Berlin
  • 4. JCMwave GmbH

Description

Bayesian Target-Vector Optimization for Efficient Parameter Reconstruction

This publication contains the research data and example scripts for the paper “Bayesian Target-Vector Optimization for Efficient Parameter Reconstruction” [1]. The research data is found in the directory research_data, the example scripts are found in the directory example_scripts.

The research data contains all necessary information to be able to reconstruct the figures and values given in the paper, as well as all result figures shown. Where possible, the directories contain the necessary scripts to recreate the results themselves, up to stochastic variations.

The example scripts are intended to show how one can (i), perform a least-square type optimization of a model function (here we focus our efforts on the analytical model functions MGH17 and Gauss3, as described in the paper) using various methods (BTVO, LM, BO, L-BFGS-B, NM, including using derivative information when applicable), and (ii), perform Markov chain Monte Carlo (MCMC) sampling around the found maximum likelihood estimate (MLE) to estimate the uncertainties of the MLE parameter (both using a surrogate model of the actual model function, as well as using the actual model function directly).

 

Research data

Contained are directories for the experimental problem GIXRF, and the two analytical model functions MGH17 and Gauss3. What follows is a listing of directories and the contents:

  • gauss3_optimization: Optimization logs for the Gauss3 model function for BTVO, LM, BO, L-BFGS-B, NM (with derivatives when applicable), .npy files used for generating the plots, a benchmark.py file used for the generation of the data, as well as the plots shown in the paper.
  • mgh17_optimization: Optimization logs for the MGH17 model function for BTVO, LM, BO, L-BFGS-B, NM (with derivatives when applicable), .npy files used for generating the plots, a benchmark.py file used for the generation of the data, as well as the plots shown in the paper.
  • mgh17_mcmc_analytical: Scripts for the creation of the plots (does not use an optimization log), as well as plots shown in the paper. This uses the model function directly to perform the MCMC sampling.
  • mgh17_mcmc_surrogate: Optimization log of the MGH17 function used for the creation of the MCMC plots, scripts for the creation of the plots (use the optimization log), as well as plots shown in the paper. This uses a surrogate model to perform the MCMC sampling.
  • gixrf_optimization: benchmark.py file to perform the optimization, the optimization logs for the various methods (BTVO, LM, BO, L-BFGS-B, NM), .npy files and scripts used for the creation of the plots, and the plots shown in the paper.
  • gixrf_mcmc_supplement: optimization log used for the creation of the plot, pickle file used for the creation of the plot, script to create the MCMC plot.
  • gixrf_optimum_difference_supplement: optimization logs of BTVO optimization of the GIXRF problem, scripts to create the difference/error plots shown for the GIXRF problem in the supplement, and the plots themselves.

Employed software for creating the research data

The software used in the creation is:

  • JCMsuite Analysis and Optimization toolkit, development version, commit d55e99b (the closest commercial release is found in JCMsuite version 5.0.2)
  • A list of Python packages installed (excerpt from conda list, name and version)
    • corner 2.1.0
    • emcee 3.0.2
    • jax 0.2.22
    • jaxlib 0.1.72
    • matplotlib 3.2.1
    • numba 0.40.1
    • numpy 1.18.1
    • pandas 0.24.1
    • python 3.7.11
    • scikit-optimize 0.7.4
    • scipy 1.7.1
    • tikzplotlib 0.9.9
  • JCMsuite 4.6.3 for the evaluation of the experimental model

 

Example scripts

This directory contains a few sample files that show how parameter reconstructions can be performed using the JCMsuite analysis and optimization toolbox, with a particular focus on the Bayesian target-vector optimization method shown in the paper.

It also contains example files that show how an uncertainty quantification can be performed using MCMC, both directly using a model function, as well as using a surrogate model of the model function.

What follows is a listing of the contents of the directory:

  • mcmc_mgh17_analytical.py: performs a MCMC analysis of the MGH17 model function directly, without constructing a surrogate model. Uses emcee.
  • mcmc_mgh17_surrogate.py: performs a MCMC analysis of the MGH17 model function by constructing a surrogate model of the model function. Uses the JCMsuite analysis and optimization toolbox.
  • opt_gauss3.py: performs a parameter reconstruction of the Gauss3 model function using various methods (BTVO, LM, BO, L-BFGS-B, NM, with derivatives when applicable).
  • opt_mgh17.py: performs a parameter reconstruction of the MGH17 model function using various methods (BTVO, LM, BO, L-BFGS-B, NM, with derivatives when applicable).
  • util/model_functions.py: contains the MGH17 and Gauss3 model functions, their (automatic) derivatives, and objective functions used in the optimizations.

Requirements to execute the example scripts

These scripts have been developed and tested under Linux, Debian 10. We have tried to make sure that they would also work in a Windows environment, but can unfortunately give no guarantees for that.

We mainly use Python to run the reconstructions. To execute the files, a few Python packages have to be installed. In addition to the usual scientific Python stack (NumPy, SciPy, matplotlib, pandas, etc.), the packages jax and jaxlib (for automatic differentiation of Python/NumPy functions), emcee and corner (for MCMC sampling and subsequent plotting of the results) have to be installed.

This can be achieved for example using pip, e.g.

pip install -r requirements.txt

Additionally, JCMsuite has to be installed. For this you can visit [2] and download a free trial version.

On Linux, the installation has to be added to the PATH, e.g. by adding the following to your .bashrc file:

export JCMROOT=/FULL/PATH/TO/BASE/DIRECTORY
export PATH=$JCMROOT/bin:$PATH
export PYTHONPATH=$JCMROOT/ThirdPartySupport/Python:$PYTHONPATH

 

Bibliography

[1] M. Plock, K. Andrle, S. Burger, P.-I. Schneider, Bayesian Target-Vector Optimization for Efficient Parameter Reconstruction. Adv. Theory Simul. 5, 2200112 (2022).

[2] https://jcmwave.com/

Notes

The authors acknowledge discussions with Victor Soltwisch, Martin Hammerschmidt, and Lin Zschiedrich, and also acknowledge Philipp Hönicke for assistance in recording the experimental data set. This project was funded by the German Federal Ministry of Education and Research (BMBF, project number 05M20ZAA, siMLopt; project number 01IS20080A, SiM4diM; Forschungscampus MODAL, project number 05M20ZBM), by the German Federal Ministry for Economic Affairs and Energy (BMWi, project number 50WM2067, Optimal-QT), and by the European Union's Horizon 2020 research and innovation programme (EU H2020, grant number 101007319, AI-TWILIGHT). This project has received funding from the EMPIR programme co-financed by the Participating States and from the European Union's Horizon 2020 research and innovation programme (project 20IND04 "ATMOC"; project 20FUN02 "POLIGHT"). Open Access funding enabled and organized by Projekt DEAL.

Files

data_and_scripts.zip

Files (26.3 MB)

Name Size Download all
md5:2c91a70308af828c4bc610f0e8928e22
26.3 MB Preview Download

Additional details

Related works

Is supplement to
Journal article: 10.1002/adts.202200112 (DOI)
Preprint: 10.48550/arXiv.2202.11559 (DOI)