honegumi.ax package
Subpackages
Submodules
honegumi.ax._ax module
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following lines in the
[options.entry_points] section in setup.cfg:
console_scripts =
fibonacci = ax.skeleton:run
Then run pip install . (or pip install -e . for editable mode)
which will install the command fibonacci inside your current environment.
Besides console scripts, the header (i.e. until _logger…) of this file can
also be used as template for Python modules.
Note
This file can be renamed depending on your needs or safely removed if not needed.
References
- honegumi.ax._ax.add_model_specific_keys(option_names, opt)[source]
Add model-specific keys to the options dictionary (in-place).
This function adds model-specific keys to the options dictionary opt. For example, if use_custom_gen is a hidden variable, and the model is FULLYBAYESIAN, then use_custom_gen should be True.
It also sets the value of the key model_kwargs based on the value of MODEL_OPT_KEY in opt.
Examples
The following example is demonstrative, the range of cases may be expanded later.
>>> option_names = [ ... "objective", ... "model", ... "custom_gen", ... "existing_data", ... "sum_constraint", ... "order_constraint", ... "linear_constraint", ... "composition_constraint", ... "categorical", ... "custom_threshold", ... "fidelity", ... "synchrony", ... ] >>> opt = { ... "objective": "single", ... "model": "Default", ... "existing_data": False, ... "sum_constraint": False, ... "order_constraint": False, ... "linear_constraint": False, ... "composition_constraint": False, ... "categorical": False, ... "custom_threshold": False, ... "fidelity": "single", ... "synchrony": "single", ... }
>>> add_model_specific_keys(option_names, opt) { "objective": "single", "model": "Default", "existing_data": False, "sum_constraint": False, "order_constraint": False, "linear_constraint": False, "composition_constraint": False, "categorical": False, "custom_threshold": False, "fidelity": "single", "synchrony": "single", "custom_gen": False, "model_kwargs": {}, }
- honegumi.ax._ax.is_incompatible(opt)[source]
Check if the given option dictionary contains incompatible options.
An option is considered incompatible if it cannot be used together with another option. For example, if the model is fully Bayesian, it cannot use the custom generator (use_custom_gen). Similarly, if the objective is single, it cannot use the custom threshold (use_custom_threshold).