It reads the configuration from a dict
or a json / yaml file and starts the Bayesian optimization.
Important notes for new BO Practitioner: The code in this repository serves as a good initial point to understand how BO can be implemented. For a more systematic and maintainable solution, we kindly refer to the Xopt package, which provides more BO variants and is designed to be a generic optimizer.
The results are published in the IPAC'23 proceeding: https://doi.org/10.18429/JACoW-IPAC-23-THPL028 (Pre-proceeding version)
- Currently a basic plotting is implemented in
utils.plot_progress
, but using it in VS-Code shows some flickering (see this issue), in plain jupyter notebook it works smoothly. pydoocs
require additional packagejpeg
that needs to be installed via condaconda install -c conda-forge jpeg
.
The json configuration files contain the following tuning tasks
SASE1_CAX_CAY.json
SASE1 tuning with undulator air coil correctorsSASE1_matching_quads.json
SASE1 tuning with quadrupole magnetsSASE2_CAX_CAY.json
,SASE2_CAX_CAY_Launch.json
SASE2 tuning with air coil correctorsSASE2_matching_quads.json
SASE2 tuning with quadrupole magnets
simplebo.py
Implements the basic BO logicconf/*.json
Configuration files for optimization taskstest_rosenbrock.json
A template for optimizating a test function
utils.py
Utility functions, e.g. the proximial acquisition function implemented in Xopt
It is recommended to use a virtual environment, e.g. conda
. With the environment activated, simply do
pip install -r requirements.txt
(For pydoocs users): Simply define your problem in a json file structured as the Ocelot optimizer configuration. Load the config into the SimpleBO
object and start with optimize
.
TODO:
- Basic BO functionality
- BO Loop
- Basic logging
- Advanced control:
- Custom start condition: random initialization, start from current setting
- Fine tuning the Acq, Prior...
- Step size control: hard / proximal biasing
- More information in the logging
- Preliminary Tests:
- BO test with simple mathematical functions
- I/O test with pydoocs
- Environment test on xfeluser server
- (Check compatibility) Environment test on control room PCs
- Provide a beam time note book with the defined procedures
- Other features
- live progress plot
- (If enough time): try direct interface with Xopt, this will be a sustainable and more preferred way for productive tools.