Skip to content

Commit

Permalink
Fix MTBO one-hot encoding bug + improve docs (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosfelt authored Apr 14, 2021
1 parent dbe49b1 commit 6f33bb4
Show file tree
Hide file tree
Showing 136 changed files with 720 additions and 610 deletions.
16 changes: 14 additions & 2 deletions docs/source/strategies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ With the updated model, we use one of two classes of techniques to select our ne
:height: 300 px
:figclass: align-center

Illustration of how acquisition functions eanble BO strategies to reduce uncertainty and maximise objective simulataneously. Dotted line is actual objective and solid line is posterior of surrogate model. Acquisition function is high where objective to be optimal (exploration) and where there is high uncertainty (exploitation). Adapted from `Shahriari et al. <https://www.cs.ox.ac.uk/people/nando.defreitas/publications/BayesOptLoop.pdf>`_
Illustration of how acquisition functions eanble BO strategies to reduce uncertainty and maximise objective simulataneously. Dotted line is actual objective and solid line is posterior of surrogate model. Acquisition function is high where objective to be optimal (exploration) and where there is high uncertainty (exploitation). Adapted from `Shahriari et al. <https://ieeexplore.ieee.org/document/7352306>`_

To learn more about BO, we suggest reading the review by `Shahriari et al. <https://www.cs.ox.ac.uk/people/nando.defreitas/publications/BayesOptLoop.pdf>`_
To learn more about BO, we suggest reading the review by `Shahriari et al. <https://ieeexplore.ieee.org/document/7352306>`_

The BO strategies available in Summit are:

* TSEMO_
* SOBO_
* MTBO_
* ENTMOOT_


Expand All @@ -49,6 +50,16 @@ SOBO
.. autoclass:: summit.strategies.sobo.SOBO
:members:


MTBO
^^^^

.. _MTBO:

.. autoclass:: summit.strategies.MTBO
:members:
:inherited-members:

ENTMOOT
^^^^^^^

Expand All @@ -57,6 +68,7 @@ ENTMOOT
.. autoclass:: summit.strategies.ENTMOOT
:members:


Reinforcement Learning
----------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"domain": [{"type": "CategoricalVariable", "is_objective": false, "name": "catalyst", "description": "Catalyst type", "units": null, "levels": ["tBuXPhos", "tBuBrettPhos", "AlPhos"], "ds": {"index": ["tBuXPhos", "tBuBrettPhos", "AlPhos"], "columns": [["area_cat", "DATA"], ["M2_cat", "DATA"]], "data": [[460.7543, 67.2057], [518.8408, 89.8738], [819.933, 129.0808]]}}, {"type": "CategoricalVariable", "is_objective": false, "name": "base", "description": "Base", "units": null, "levels": ["BTTP", "BTMG", "DBU", "MTBD"], "ds": null}, {"type": "ContinuousVariable", "is_objective": false, "name": "base_equivalents", "description": "Base equivalents", "units": null, "bounds": [1.0, 2.5]}, {"type": "ContinuousVariable", "is_objective": false, "name": "temperature", "description": "Temperature in degrees Celsius (\u00baC)", "units": null, "bounds": [30.0, 100.0]}, {"type": "ContinuousVariable", "is_objective": false, "name": "t_res", "description": "residence time in seconds (s)", "units": null, "bounds": [60.0, 1800.0]}, {"type": "ContinuousVariable", "is_objective": true, "name": "yield", "description": "Yield", "units": null, "bounds": [0.0, 1.0]}], "name": "ExperimentalEmulator", "data": {"index": [], "columns": [["catalyst", "DATA"], ["base", "DATA"], ["base_equivalents", "DATA"], ["temperature", "DATA"], ["t_res", "DATA"], ["yield", "DATA"], ["computation_t", "METADATA"], ["experiment_t", "METADATA"], ["strategy", "METADATA"]], "data": []}, "experiment_params": {"model_name": "baumgartner_primary_amine", "regressor_name": "ANNRegressor", "n_features": 10, "n_examples": 92, "descriptors_features": [], "output_variable_names": ["yield"], "predictors": [{"input_preprocessor": {"num": {"mean_": [1.6433899101513958, 77.7690909090909, 732.7608206142079], "var_": [0.12978876347780144, 753.5497719008265, 371643.348125646], "scale_": [0.3602620761026637, 27.45086104115546, 609.6255802750128], "n_samples_seen_": 55}}, "output_preprocessor": {"mean_": [0.4522085499145429], "var_": [0.15275946137050844], "scale_": [0.39084454885607456], "n_samples_seen_": 55}}, {"input_preprocessor": {"num": {"mean_": [1.6189573775076675, 74.81272727272727, 810.9457470980558], "var_": [0.13795978110802035, 832.2982016528924, 384193.0280846722], "scale_": [0.37142937566651935, 28.849578881725336, 619.8330646913507], "n_samples_seen_": 55}}, "output_preprocessor": {"mean_": [0.48744336173404007], "var_": [0.14849834688886238], "scale_": [0.3853548324451925], "n_samples_seen_": 55}}, {"input_preprocessor": {"num": {"mean_": [1.6285175488857782, 79.79818181818183, 781.0131804813038], "var_": [0.13940704012600072, 693.8216330578513, 389947.7201171372], "scale_": [0.37337252192147286, 26.340494168824, 624.4579410313694], "n_samples_seen_": 55}}, "output_preprocessor": {"mean_": [0.4867995243329047], "var_": [0.1458822295239026], "scale_": [0.38194532268886683], "n_samples_seen_": 55}}, {"input_preprocessor": {"num": {"mean_": [1.5791994991469978, 76.1381818181818, 800.1719308419661], "var_": [0.14730072854572404, 761.1507239669419, 394083.7678590847], "scale_": [0.3837977703761762, 27.588960182778578, 627.7609161608301], "n_samples_seen_": 55}}, "output_preprocessor": {"mean_": [0.4951012723190202], "var_": [0.1582074359916574], "scale_": [0.3977529836363989], "n_samples_seen_": 55}}, {"input_preprocessor": {"num": {"mean_": [1.6307636010361506, 75.75535714285715, 832.615480014256], "var_": [0.13706793334467066, 768.2367570153064, 385465.5730380972], "scale_": [0.3702268673998021, 27.717084208395846, 620.8587383923151], "n_samples_seen_": 56}}, "output_preprocessor": {"mean_": [0.44402859465169187], "var_": [0.16073403177350493], "scale_": [0.40091648977499655], "n_samples_seen_": 56}}]}, "extras": []}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"runner": {"num_initial_experiments": null, "max_iterations": 20, "batch_size": 1, "f_tol": 1e-05, "max_restarts": 0}, "strategy": {"name": "MTBO", "transform": {"transform_domain": [{"type": "CategoricalVariable", "is_objective": false, "name": "catalyst", "description": "Catalyst type", "units": null, "levels": ["tBuXPhos", "tBuBrettPhos", "AlPhos"], "ds": {"index": ["tBuXPhos", "tBuBrettPhos", "AlPhos"], "columns": [["area_cat", "DATA"], ["M2_cat", "DATA"]], "data": [[460.7543, 67.2057], [518.8408, 89.8738], [819.933, 129.0808]]}}, {"type": "CategoricalVariable", "is_objective": false, "name": "base", "description": "Base", "units": null, "levels": ["BTTP", "BTMG", "DBU", "MTBD"], "ds": null}, {"type": "ContinuousVariable", "is_objective": false, "name": "base_equivalents", "description": "Base equivalents", "units": null, "bounds": [1.0, 2.5]}, {"type": "ContinuousVariable", "is_objective": false, "name": "temperature", "description": "Temperature in degrees Celsius (\u00baC)", "units": null, "bounds": [30.0, 100.0]}, {"type": "ContinuousVariable", "is_objective": false, "name": "t_res", "description": "residence time in seconds (s)", "units": null, "bounds": [60.0, 1800.0]}, {"type": "ContinuousVariable", "is_objective": true, "name": "yield", "description": "Yield", "units": null, "bounds": [0.0, 1.0]}], "name": "Transform", "domain": [{"type": "CategoricalVariable", "is_objective": false, "name": "catalyst", "description": "Catalyst type", "units": null, "levels": ["tBuXPhos", "tBuBrettPhos", "AlPhos"], "ds": {"index": ["tBuXPhos", "tBuBrettPhos", "AlPhos"], "columns": [["area_cat", "DATA"], ["M2_cat", "DATA"]], "data": [[460.7543, 67.2057], [518.8408, 89.8738], [819.933, 129.0808]]}}, {"type": "CategoricalVariable", "is_objective": false, "name": "base", "description": "Base", "units": null, "levels": ["BTTP", "BTMG", "DBU", "MTBD"], "ds": null}, {"type": "ContinuousVariable", "is_objective": false, "name": "base_equivalents", "description": "Base equivalents", "units": null, "bounds": [1.0, 2.5]}, {"type": "ContinuousVariable", "is_objective": false, "name": "temperature", "description": "Temperature in degrees Celsius (\u00baC)", "units": null, "bounds": [30.0, 100.0]}, {"type": "ContinuousVariable", "is_objective": false, "name": "t_res", "description": "residence time in seconds (s)", "units": null, "bounds": [60.0, 1800.0]}, {"type": "ContinuousVariable", "is_objective": true, "name": "yield", "description": "Yield", "units": null, "bounds": [0.0, 1.0]}], "transform_params": {}}, "strategy_params": {"all_experiments": {"index": [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "columns": [["catalyst", "DATA"], ["base", "DATA"], ["base_equivalents", "DATA"], ["temperature", "DATA"], ["t_res", "DATA"], ["yield", "DATA"], ["computation_t", "METADATA"], ["experiment_t", "METADATA"], ["strategy", "METADATA"], ["task", "METADATA"]], "data": [["tBuXPhos", "BTTP", 2.125, 82.5, 495.0, 0.8031633496284485, 0.0, 0.039190053939819336, "LHS", 1.0], ["AlPhos", "BTTP", 1.375, 47.5, 1365.0, 0.932254433631897, 0.0, 0.03976082801818848, "LHS", 1.0], ["AlPhos", "BTTP", 1.163477897644043, 68.20264434814453, 1800.0, 0.9977060556411743, 3.4609227180480957, 0.030591964721679688, "MTBO", 1.0], ["AlPhos", "BTTP", 1.1810085773468018, 65.93614196777344, 1800.0, 0.9983388781547546, 1.8297340869903564, 0.038281917572021484, "MTBO", 1.0], ["AlPhos", "BTTP", 1.200371265411377, 67.4896240234375, 1800.0, 1.0, 2.0852811336517334, 0.030476093292236328, "MTBO", 1.0], ["AlPhos", "BTTP", 1.431157112121582, 68.3565902709961, 1671.76025390625, 1.0, 1.7265970706939697, 0.030106067657470703, "MTBO", 1.0], ["AlPhos", "BTTP", 1.2855861186981201, 64.85208129882812, 1745.18212890625, 1.0, 3.839944839477539, 0.038710594177246094, "MTBO", 1.0], ["AlPhos", "BTTP", 1.3503124713897705, 67.24772644042969, 1719.7197265625, 1.0, 2.4471189975738525, 0.03168916702270508, "MTBO", 1.0], ["AlPhos", "BTTP", 1.1549394130706787, 66.33074951171875, 1800.0, 0.9959722757339478, 2.9563791751861572, 0.028990983963012695, "MTBO", 1.0], ["AlPhos", "BTTP", 1.33616042137146, 68.44651794433594, 1797.897216796875, 1.0, 4.110234260559082, 0.03172802925109863, "MTBO", 1.0], ["AlPhos", "BTTP", 1.5323737859725952, 68.9630126953125, 1693.62109375, 1.0, 2.1891300678253174, 0.03180408477783203, "MTBO", 1.0], ["AlPhos", "BTTP", 1.3426467180252075, 66.57575988769531, 1738.040283203125, 1.0, 1.6926929950714111, 0.030109882354736328, "MTBO", 1.0], ["AlPhos", "BTTP", 1.3669359683990479, 66.5360107421875, 1395.382568359375, 1.0, 2.829677104949951, 0.03584575653076172, "MTBO", 1.0], ["AlPhos", "BTTP", 1.5615137815475464, 53.81058883666992, 1359.92578125, 0.9918607473373413, 4.797755002975464, 0.045375823974609375, "MTBO", 1.0], ["AlPhos", "BTTP", 1.5345615148544312, 61.66748046875, 1549.867919921875, 1.0, 4.9743812084198, 0.03585195541381836, "MTBO", 1.0], ["AlPhos", "BTTP", 1.2645065784454346, 61.865821838378906, 1752.38134765625, 1.0, 2.0327069759368896, 0.03057098388671875, "MTBO", 1.0], ["AlPhos", "BTTP", 1.271968960762024, 67.43891906738281, 1262.8048095703125, 0.9663092494010925, 2.946610927581787, 0.04000687599182129, "MTBO", 1.0], ["AlPhos", "BTTP", 1.2886420488357544, 63.50016403198242, 1514.847412109375, 0.9973722696304321, 2.6807632446289062, 0.030769824981689453, "MTBO", 1.0], ["AlPhos", "BTTP", 1.4443421363830566, 59.67304229736328, 1362.010498046875, 0.9968655705451965, 3.1751291751861572, 0.03396105766296387, "MTBO", 1.0], ["AlPhos", "BTTP", 1.4641574621200562, 52.60327911376953, 1514.437744140625, 1.0, 1.9494881629943848, 0.02869415283203125, "MTBO", 1.0]]}, "categorical_method": "one-hot", "task": 1}}, "experiment": {"domain": [{"type": "CategoricalVariable", "is_objective": false, "name": "catalyst", "description": "Catalyst type", "units": null, "levels": ["tBuXPhos", "tBuBrettPhos", "AlPhos"], "ds": {"index": ["tBuXPhos", "tBuBrettPhos", "AlPhos"], "columns": [["area_cat", "DATA"], ["M2_cat", "DATA"]], "data": [[460.7543, 67.2057], [518.8408, 89.8738], [819.933, 129.0808]]}}, {"type": "CategoricalVariable", "is_objective": false, "name": "base", "description": "Base", "units": null, "levels": ["BTTP", "BTMG", "DBU", "MTBD"], "ds": null}, {"type": "ContinuousVariable", "is_objective": false, "name": "base_equivalents", "description": "Base equivalents", "units": null, "bounds": [1.0, 2.5]}, {"type": "ContinuousVariable", "is_objective": false, "name": "temperature", "description": "Temperature in degrees Celsius (\u00baC)", "units": null, "bounds": [30.0, 100.0]}, {"type": "ContinuousVariable", "is_objective": false, "name": "t_res", "description": "residence time in seconds (s)", "units": null, "bounds": [60.0, 1800.0]}, {"type": "ContinuousVariable", "is_objective": true, "name": "yield", "description": "Yield", "units": null, "bounds": [0.0, 1.0]}], "name": "ExperimentalEmulator", "data": {"index": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], "columns": [["catalyst", "DATA"], ["base", "DATA"], ["base_equivalents", "DATA"], ["temperature", "DATA"], ["t_res", "DATA"], ["yield", "DATA"], ["computation_t", "METADATA"], ["experiment_t", "METADATA"], ["strategy", "METADATA"], ["task", "METADATA"]], "data": [["tBuXPhos", "BTTP", 2.125, 82.5, 495.0, 0.8031633496284485, 0.0, 0.039190053939819336, "LHS", 1.0], ["AlPhos", "BTTP", 1.375, 47.5, 1365.0, 0.932254433631897, 0.0, 0.03976082801818848, "LHS", 1.0], ["AlPhos", "BTTP", 1.163477897644043, 68.20264434814453, 1800.0, 0.9977060556411743, 3.4609227180480957, 0.030591964721679688, "MTBO", 1.0], ["AlPhos", "BTTP", 1.1810085773468018, 65.93614196777344, 1800.0, 0.9983388781547546, 1.8297340869903564, 0.038281917572021484, "MTBO", 1.0], ["AlPhos", "BTTP", 1.200371265411377, 67.4896240234375, 1800.0, 1.0, 2.0852811336517334, 0.030476093292236328, "MTBO", 1.0], ["AlPhos", "BTTP", 1.431157112121582, 68.3565902709961, 1671.76025390625, 1.0, 1.7265970706939697, 0.030106067657470703, "MTBO", 1.0], ["AlPhos", "BTTP", 1.2855861186981201, 64.85208129882812, 1745.18212890625, 1.0, 3.839944839477539, 0.038710594177246094, "MTBO", 1.0], ["AlPhos", "BTTP", 1.3503124713897705, 67.24772644042969, 1719.7197265625, 1.0, 2.4471189975738525, 0.03168916702270508, "MTBO", 1.0], ["AlPhos", "BTTP", 1.1549394130706787, 66.33074951171875, 1800.0, 0.9959722757339478, 2.9563791751861572, 0.028990983963012695, "MTBO", 1.0], ["AlPhos", "BTTP", 1.33616042137146, 68.44651794433594, 1797.897216796875, 1.0, 4.110234260559082, 0.03172802925109863, "MTBO", 1.0], ["AlPhos", "BTTP", 1.5323737859725952, 68.9630126953125, 1693.62109375, 1.0, 2.1891300678253174, 0.03180408477783203, "MTBO", 1.0], ["AlPhos", "BTTP", 1.3426467180252075, 66.57575988769531, 1738.040283203125, 1.0, 1.6926929950714111, 0.030109882354736328, "MTBO", 1.0], ["AlPhos", "BTTP", 1.3669359683990479, 66.5360107421875, 1395.382568359375, 1.0, 2.829677104949951, 0.03584575653076172, "MTBO", 1.0], ["AlPhos", "BTTP", 1.5615137815475464, 53.81058883666992, 1359.92578125, 0.9918607473373413, 4.797755002975464, 0.045375823974609375, "MTBO", 1.0], ["AlPhos", "BTTP", 1.5345615148544312, 61.66748046875, 1549.867919921875, 1.0, 4.9743812084198, 0.03585195541381836, "MTBO", 1.0], ["AlPhos", "BTTP", 1.2645065784454346, 61.865821838378906, 1752.38134765625, 1.0, 2.0327069759368896, 0.03057098388671875, "MTBO", 1.0], ["AlPhos", "BTTP", 1.271968960762024, 67.43891906738281, 1262.8048095703125, 0.9663092494010925, 2.946610927581787, 0.04000687599182129, "MTBO", 1.0], ["AlPhos", "BTTP", 1.2886420488357544, 63.50016403198242, 1514.847412109375, 0.9973722696304321, 2.6807632446289062, 0.030769824981689453, "MTBO", 1.0], ["AlPhos", "BTTP", 1.4443421363830566, 59.67304229736328, 1362.010498046875, 0.9968655705451965, 3.1751291751861572, 0.03396105766296387, "MTBO", 1.0], ["AlPhos", "BTTP", 1.4641574621200562, 52.60327911376953, 1514.437744140625, 1.0, 1.9494881629943848, 0.02869415283203125, "MTBO", 1.0], ["AlPhos", "BTTP", 1.463046908378601, 57.9471549987793, 1606.17919921875, 1.0, 3.123176097869873, 0.030063867568969727, "MTBO", 1.0]]}, "experiment_params": {"model_name": "baumgartner_primary_amine", "regressor_name": "ANNRegressor", "n_features": 10, "n_examples": 92, "descriptors_features": [], "output_variable_names": ["yield"], "predictors": [{"input_preprocessor": {"num": {"mean_": [1.6433899101513958, 77.7690909090909, 732.7608206142079], "var_": [0.12978876347780144, 753.5497719008265, 371643.348125646], "scale_": [0.3602620761026637, 27.45086104115546, 609.6255802750128], "n_samples_seen_": 55}}, "output_preprocessor": {"mean_": [0.4522085499145429], "var_": [0.15275946137050844], "scale_": [0.39084454885607456], "n_samples_seen_": 55}}, {"input_preprocessor": {"num": {"mean_": [1.6189573775076675, 74.81272727272727, 810.9457470980558], "var_": [0.13795978110802035, 832.2982016528924, 384193.0280846722], "scale_": [0.37142937566651935, 28.849578881725336, 619.8330646913507], "n_samples_seen_": 55}}, "output_preprocessor": {"mean_": [0.48744336173404007], "var_": [0.14849834688886238], "scale_": [0.3853548324451925], "n_samples_seen_": 55}}, {"input_preprocessor": {"num": {"mean_": [1.6285175488857782, 79.79818181818183, 781.0131804813038], "var_": [0.13940704012600072, 693.8216330578513, 389947.7201171372], "scale_": [0.37337252192147286, 26.340494168824, 624.4579410313694], "n_samples_seen_": 55}}, "output_preprocessor": {"mean_": [0.4867995243329047], "var_": [0.1458822295239026], "scale_": [0.38194532268886683], "n_samples_seen_": 55}}, {"input_preprocessor": {"num": {"mean_": [1.5791994991469978, 76.1381818181818, 800.1719308419661], "var_": [0.14730072854572404, 761.1507239669419, 394083.7678590847], "scale_": [0.3837977703761762, 27.588960182778578, 627.7609161608301], "n_samples_seen_": 55}}, "output_preprocessor": {"mean_": [0.4951012723190202], "var_": [0.1582074359916574], "scale_": [0.3977529836363989], "n_samples_seen_": 55}}, {"input_preprocessor": {"num": {"mean_": [1.6307636010361506, 75.75535714285715, 832.615480014256], "var_": [0.13706793334467066, 768.2367570153064, 385465.5730380972], "scale_": [0.3702268673998021, 27.717084208395846, 620.8587383923151], "n_samples_seen_": 56}}, "output_preprocessor": {"mean_": [0.44402859465169187], "var_": [0.16073403177350493], "scale_": [0.40091648977499655], "n_samples_seen_": 56}}]}, "extras": [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]}}
Loading

0 comments on commit 6f33bb4

Please sign in to comment.