{ "cells": [ { "cell_type": "markdown", "metadata": { "tags": [] }, "source": [ "# Running BOA Optimization Directly in Python\n", "\n", "This notebook demonstrates how to:\n", "\n", "Write a basic Wrapper in Python and launch a optimization from Python.\n", "If you wanted to launch it from command line, you would do a similar thing of defining the Wrapper, and then put in your configuration file the information about where the wrapper is, and use [BOA's](../index.rst) CLI tools. See [Running an Experiment from Command Line (Python Wrapper)](example_py_run.rst) for more information." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "application/javascript": [ "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) {\n", " if (callback != null)\n", " callback();\n", " });\n", " } finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.debug(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(css_urls, js_urls, js_modules, callback) {\n", " if (css_urls == null) css_urls = [];\n", " if (js_urls == null) js_urls = [];\n", " if (js_modules == null) js_modules = [];\n", "\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls.length === 0 && js_modules.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", "\n", " function on_load() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n", " run_callbacks()\n", " }\n", " }\n", "\n", " function on_error() {\n", " console.error(\"failed to load \" + url);\n", " }\n", "\n", " for (var i = 0; i < css_urls.length; i++) {\n", " var url = css_urls[i];\n", " const element = document.createElement(\"link\");\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.rel = \"stylesheet\";\n", " element.type = \"text/css\";\n", " element.href = url;\n", " console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n", " document.body.appendChild(element);\n", " }\n", "\n", " var skip = [];\n", " if (window.requirejs) {\n", " window.requirejs.config({'packages': {}, 'paths': {'plotly': 'https://cdn.plot.ly/plotly-2.18.0.min', 'gridstack': 'https://cdn.jsdelivr.net/npm/gridstack@4.2.5/dist/gridstack-h5', 'notyf': 'https://cdn.jsdelivr.net/npm/notyf@3/notyf.min'}, 'shim': {'gridstack': {'exports': 'GridStack'}}});\n", " require([\"plotly\"], function(Plotly) {\n", "\twindow.Plotly = Plotly\n", "\ton_load()\n", " })\n", " require([\"gridstack\"], function(GridStack) {\n", "\twindow.GridStack = GridStack\n", "\ton_load()\n", " })\n", " require([\"notyf\"], function() {\n", "\ton_load()\n", " })\n", " root._bokeh_is_loading = css_urls.length + 3;\n", " } else {\n", " root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length;\n", " } if (((window['Plotly'] !== undefined) && (!(window['Plotly'] instanceof HTMLElement))) || window.requirejs) {\n", " var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/plotlyplot/plotly-2.18.0.min.js'];\n", " for (var i = 0; i < urls.length; i++) {\n", " skip.push(urls[i])\n", " }\n", " } if (((window['GridStack'] !== undefined) && (!(window['GridStack'] instanceof HTMLElement))) || window.requirejs) {\n", " var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/gridstack/gridstack@4.2.5/dist/gridstack-h5.js'];\n", " for (var i = 0; i < urls.length; i++) {\n", " skip.push(urls[i])\n", " }\n", " } if (((window['Notyf'] !== undefined) && (!(window['Notyf'] instanceof HTMLElement))) || window.requirejs) {\n", " var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/notificationarea/notyf@3/notyf.min.js'];\n", " for (var i = 0; i < urls.length; i++) {\n", " skip.push(urls[i])\n", " }\n", " } for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " if (skip.indexOf(url) >= 0) {\n", "\tif (!window.requirejs) {\n", "\t on_load();\n", "\t}\n", "\tcontinue;\n", " }\n", " var element = document.createElement('script');\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.async = false;\n", " element.src = url;\n", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.head.appendChild(element);\n", " }\n", " for (var i = 0; i < js_modules.length; i++) {\n", " var url = js_modules[i];\n", " if (skip.indexOf(url) >= 0) {\n", "\tif (!window.requirejs) {\n", "\t on_load();\n", "\t}\n", "\tcontinue;\n", " }\n", " var element = document.createElement('script');\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.async = false;\n", " element.src = url;\n", " element.type = \"module\";\n", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.head.appendChild(element);\n", " }\n", " if (!js_urls.length && !js_modules.length) {\n", " on_load()\n", " }\n", " };\n", "\n", " function inject_raw_css(css) {\n", " const element = document.createElement(\"style\");\n", " element.appendChild(document.createTextNode(css));\n", " document.body.appendChild(element);\n", " }\n", "\n", " var js_urls = [\"https://cdn.holoviz.org/panel/0.14.4/dist/bundled/jquery/jquery.slim.min.js\", \"https://cdn.holoviz.org/panel/0.14.4/dist/bundled/plotlyplot/plotly-2.18.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.3.min.js\", \"https://unpkg.com/@holoviz/panel@0.14.4/dist/panel.min.js\"];\n", " var js_modules = [];\n", " var css_urls = [\"https://cdn.holoviz.org/panel/0.14.4/dist/css/debugger.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/alerts.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/card.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/widgets.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/markdown.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/json.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/loading.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/dataframe.css\"];\n", " var inline_js = [ function(Bokeh) {\n", " inject_raw_css(\"\\n .bk.pn-loading.arc:before {\\n background-image: url(\\\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJtYXJnaW46IGF1dG87IGJhY2tncm91bmQ6IG5vbmU7IGRpc3BsYXk6IGJsb2NrOyBzaGFwZS1yZW5kZXJpbmc6IGF1dG87IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjYzNjM2MzIiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij4gICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjFzIiB2YWx1ZXM9IjAgNTAgNTA7MzYwIDUwIDUwIiBrZXlUaW1lcz0iMDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+ICA8L2NpcmNsZT48L3N2Zz4=\\\");\\n background-size: auto calc(min(50%, 400px));\\n }\\n \");\n", " }, function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", "function(Bokeh) {} // ensure no trailing comma for IE\n", " ];\n", "\n", " function run_inline_js() {\n", " if ((root.Bokeh !== undefined) || (force === true)) {\n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " }\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(css_urls, js_urls, js_modules, function() {\n", " console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.holoviews_load.v0+json": "(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, js_modules, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n if (js_modules == null) js_modules = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls.length === 0 && js_modules.length === 0) {\n run_callbacks();\n return null;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error() {\n console.error(\"failed to load \" + url);\n }\n\n for (var i = 0; i < css_urls.length; i++) {\n var url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n var skip = [];\n if (window.requirejs) {\n window.requirejs.config({'packages': {}, 'paths': {'plotly': 'https://cdn.plot.ly/plotly-2.18.0.min', 'gridstack': 'https://cdn.jsdelivr.net/npm/gridstack@4.2.5/dist/gridstack-h5', 'notyf': 'https://cdn.jsdelivr.net/npm/notyf@3/notyf.min'}, 'shim': {'gridstack': {'exports': 'GridStack'}}});\n require([\"plotly\"], function(Plotly) {\n\twindow.Plotly = Plotly\n\ton_load()\n })\n require([\"gridstack\"], function(GridStack) {\n\twindow.GridStack = GridStack\n\ton_load()\n })\n require([\"notyf\"], function() {\n\ton_load()\n })\n root._bokeh_is_loading = css_urls.length + 3;\n } else {\n root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length;\n } if (((window['Plotly'] !== undefined) && (!(window['Plotly'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/plotlyplot/plotly-2.18.0.min.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } if (((window['GridStack'] !== undefined) && (!(window['GridStack'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/gridstack/gridstack@4.2.5/dist/gridstack-h5.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } if (((window['Notyf'] !== undefined) && (!(window['Notyf'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/notificationarea/notyf@3/notyf.min.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n if (skip.indexOf(url) >= 0) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (var i = 0; i < js_modules.length; i++) {\n var url = js_modules[i];\n if (skip.indexOf(url) >= 0) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n if (!js_urls.length && !js_modules.length) {\n on_load()\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n var js_urls = [\"https://cdn.holoviz.org/panel/0.14.4/dist/bundled/jquery/jquery.slim.min.js\", \"https://cdn.holoviz.org/panel/0.14.4/dist/bundled/plotlyplot/plotly-2.18.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.3.min.js\", \"https://unpkg.com/@holoviz/panel@0.14.4/dist/panel.min.js\"];\n var js_modules = [];\n var css_urls = [\"https://cdn.holoviz.org/panel/0.14.4/dist/css/debugger.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/alerts.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/card.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/widgets.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/markdown.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/json.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/loading.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/dataframe.css\"];\n var inline_js = [ function(Bokeh) {\n inject_raw_css(\"\\n .bk.pn-loading.arc:before {\\n background-image: url(\\\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJtYXJnaW46IGF1dG87IGJhY2tncm91bmQ6IG5vbmU7IGRpc3BsYXk6IGJsb2NrOyBzaGFwZS1yZW5kZXJpbmc6IGF1dG87IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjYzNjM2MzIiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij4gICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjFzIiB2YWx1ZXM9IjAgNTAgNTA7MzYwIDUwIDUwIiBrZXlUaW1lcz0iMDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+ICA8L2NpcmNsZT48L3N2Zz4=\\\");\\n background-size: auto calc(min(50%, 400px));\\n }\\n \");\n }, function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {} // ensure no trailing comma for IE\n ];\n\n function run_inline_js() {\n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n }\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, js_modules, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "if ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n", " window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n", "}\n", "\n", "\n", " function JupyterCommManager() {\n", " }\n", "\n", " JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n", " if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n", " var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n", " comm_manager.register_target(comm_id, function(comm) {\n", " comm.on_msg(msg_handler);\n", " });\n", " } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n", " window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n", " comm.onMsg = msg_handler;\n", " });\n", " } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n", " google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n", " var messages = comm.messages[Symbol.asyncIterator]();\n", " function processIteratorResult(result) {\n", " var message = result.value;\n", " console.log(message)\n", " var content = {data: message.data, comm_id};\n", " var buffers = []\n", " for (var buffer of message.buffers || []) {\n", " buffers.push(new DataView(buffer))\n", " }\n", " var metadata = message.metadata || {};\n", " var msg = {content, buffers, metadata}\n", " msg_handler(msg);\n", " return messages.next().then(processIteratorResult);\n", " }\n", " return messages.next().then(processIteratorResult);\n", " })\n", " }\n", " }\n", "\n", " JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n", " if (comm_id in window.PyViz.comms) {\n", " return window.PyViz.comms[comm_id];\n", " } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n", " var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n", " var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n", " if (msg_handler) {\n", " comm.on_msg(msg_handler);\n", " }\n", " } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n", " var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n", " comm.open();\n", " if (msg_handler) {\n", " comm.onMsg = msg_handler;\n", " }\n", " } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n", " var comm_promise = google.colab.kernel.comms.open(comm_id)\n", " comm_promise.then((comm) => {\n", " window.PyViz.comms[comm_id] = comm;\n", " if (msg_handler) {\n", " var messages = comm.messages[Symbol.asyncIterator]();\n", " function processIteratorResult(result) {\n", " var message = result.value;\n", " var content = {data: message.data};\n", " var metadata = message.metadata || {comm_id};\n", " var msg = {content, metadata}\n", " msg_handler(msg);\n", " return messages.next().then(processIteratorResult);\n", " }\n", " return messages.next().then(processIteratorResult);\n", " }\n", " }) \n", " var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n", " return comm_promise.then((comm) => {\n", " comm.send(data, metadata, buffers, disposeOnDone);\n", " });\n", " };\n", " var comm = {\n", " send: sendClosure\n", " };\n", " }\n", " window.PyViz.comms[comm_id] = comm;\n", " return comm;\n", " }\n", " window.PyViz.comm_manager = new JupyterCommManager();\n", " \n", "\n", "\n", "var JS_MIME_TYPE = 'application/javascript';\n", "var HTML_MIME_TYPE = 'text/html';\n", "var EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\n", "var CLASS_NAME = 'output';\n", "\n", "/**\n", " * Render data to the DOM node\n", " */\n", "function render(props, node) {\n", " var div = document.createElement(\"div\");\n", " var script = document.createElement(\"script\");\n", " node.appendChild(div);\n", " node.appendChild(script);\n", "}\n", "\n", "/**\n", " * Handle when a new output is added\n", " */\n", "function handle_add_output(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", " if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", " var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", " if (id !== undefined) {\n", " var nchildren = toinsert.length;\n", " var html_node = toinsert[nchildren-1].children[0];\n", " html_node.innerHTML = output.data[HTML_MIME_TYPE];\n", " var scripts = [];\n", " var nodelist = html_node.querySelectorAll(\"script\");\n", " for (var i in nodelist) {\n", " if (nodelist.hasOwnProperty(i)) {\n", " scripts.push(nodelist[i])\n", " }\n", " }\n", "\n", " scripts.forEach( function (oldScript) {\n", " var newScript = document.createElement(\"script\");\n", " var attrs = [];\n", " var nodemap = oldScript.attributes;\n", " for (var j in nodemap) {\n", " if (nodemap.hasOwnProperty(j)) {\n", " attrs.push(nodemap[j])\n", " }\n", " }\n", " attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n", " newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n", " oldScript.parentNode.replaceChild(newScript, oldScript);\n", " });\n", " if (JS_MIME_TYPE in output.data) {\n", " toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n", " }\n", " output_area._hv_plot_id = id;\n", " if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n", " window.PyViz.plot_index[id] = Bokeh.index[id];\n", " } else {\n", " window.PyViz.plot_index[id] = null;\n", " }\n", " } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", "}\n", "\n", "/**\n", " * Handle when an output is cleared or removed\n", " */\n", "function handle_clear_output(event, handle) {\n", " var id = handle.cell.output_area._hv_plot_id;\n", " var server_id = handle.cell.output_area._bokeh_server_id;\n", " if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n", " var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n", " if (server_id !== null) {\n", " comm.send({event_type: 'server_delete', 'id': server_id});\n", " return;\n", " } else if (comm !== null) {\n", " comm.send({event_type: 'delete', 'id': id});\n", " }\n", " delete PyViz.plot_index[id];\n", " if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n", " var doc = window.Bokeh.index[id].model.document\n", " doc.clear();\n", " const i = window.Bokeh.documents.indexOf(doc);\n", " if (i > -1) {\n", " window.Bokeh.documents.splice(i, 1);\n", " }\n", " }\n", "}\n", "\n", "/**\n", " * Handle kernel restart event\n", " */\n", "function handle_kernel_cleanup(event, handle) {\n", " delete PyViz.comms[\"hv-extension-comm\"];\n", " window.PyViz.plot_index = {}\n", "}\n", "\n", "/**\n", " * Handle update_display_data messages\n", " */\n", "function handle_update_output(event, handle) {\n", " handle_clear_output(event, {cell: {output_area: handle.output_area}})\n", " handle_add_output(event, handle)\n", "}\n", "\n", "function register_renderer(events, OutputArea) {\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[0]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " events.on('output_added.OutputArea', handle_add_output);\n", " events.on('output_updated.OutputArea', handle_update_output);\n", " events.on('clear_output.CodeCell', handle_clear_output);\n", " events.on('delete.Cell', handle_clear_output);\n", " events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n", "\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " safe: true,\n", " index: 0\n", " });\n", "}\n", "\n", "if (window.Jupyter !== undefined) {\n", " try {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " } catch(err) {\n", " }\n", "}\n" ], "application/vnd.holoviews_load.v0+json": "\nif ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n}\n\n\n function JupyterCommManager() {\n }\n\n JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n comm_manager.register_target(comm_id, function(comm) {\n comm.on_msg(msg_handler);\n });\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n comm.onMsg = msg_handler;\n });\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n console.log(message)\n var content = {data: message.data, comm_id};\n var buffers = []\n for (var buffer of message.buffers || []) {\n buffers.push(new DataView(buffer))\n }\n var metadata = message.metadata || {};\n var msg = {content, buffers, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n })\n }\n }\n\n JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n if (comm_id in window.PyViz.comms) {\n return window.PyViz.comms[comm_id];\n } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n if (msg_handler) {\n comm.on_msg(msg_handler);\n }\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n comm.open();\n if (msg_handler) {\n comm.onMsg = msg_handler;\n }\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n var comm_promise = google.colab.kernel.comms.open(comm_id)\n comm_promise.then((comm) => {\n window.PyViz.comms[comm_id] = comm;\n if (msg_handler) {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n var content = {data: message.data};\n var metadata = message.metadata || {comm_id};\n var msg = {content, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n }\n }) \n var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n return comm_promise.then((comm) => {\n comm.send(data, metadata, buffers, disposeOnDone);\n });\n };\n var comm = {\n send: sendClosure\n };\n }\n window.PyViz.comms[comm_id] = comm;\n return comm;\n }\n window.PyViz.comm_manager = new JupyterCommManager();\n \n\n\nvar JS_MIME_TYPE = 'application/javascript';\nvar HTML_MIME_TYPE = 'text/html';\nvar EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\nvar CLASS_NAME = 'output';\n\n/**\n * Render data to the DOM node\n */\nfunction render(props, node) {\n var div = document.createElement(\"div\");\n var script = document.createElement(\"script\");\n node.appendChild(div);\n node.appendChild(script);\n}\n\n/**\n * Handle when a new output is added\n */\nfunction handle_add_output(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n return\n }\n var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n if (id !== undefined) {\n var nchildren = toinsert.length;\n var html_node = toinsert[nchildren-1].children[0];\n html_node.innerHTML = output.data[HTML_MIME_TYPE];\n var scripts = [];\n var nodelist = html_node.querySelectorAll(\"script\");\n for (var i in nodelist) {\n if (nodelist.hasOwnProperty(i)) {\n scripts.push(nodelist[i])\n }\n }\n\n scripts.forEach( function (oldScript) {\n var newScript = document.createElement(\"script\");\n var attrs = [];\n var nodemap = oldScript.attributes;\n for (var j in nodemap) {\n if (nodemap.hasOwnProperty(j)) {\n attrs.push(nodemap[j])\n }\n }\n attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n oldScript.parentNode.replaceChild(newScript, oldScript);\n });\n if (JS_MIME_TYPE in output.data) {\n toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n }\n output_area._hv_plot_id = id;\n if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n window.PyViz.plot_index[id] = Bokeh.index[id];\n } else {\n window.PyViz.plot_index[id] = null;\n }\n } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n}\n\n/**\n * Handle when an output is cleared or removed\n */\nfunction handle_clear_output(event, handle) {\n var id = handle.cell.output_area._hv_plot_id;\n var server_id = handle.cell.output_area._bokeh_server_id;\n if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n if (server_id !== null) {\n comm.send({event_type: 'server_delete', 'id': server_id});\n return;\n } else if (comm !== null) {\n comm.send({event_type: 'delete', 'id': id});\n }\n delete PyViz.plot_index[id];\n if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n var doc = window.Bokeh.index[id].model.document\n doc.clear();\n const i = window.Bokeh.documents.indexOf(doc);\n if (i > -1) {\n window.Bokeh.documents.splice(i, 1);\n }\n }\n}\n\n/**\n * Handle kernel restart event\n */\nfunction handle_kernel_cleanup(event, handle) {\n delete PyViz.comms[\"hv-extension-comm\"];\n window.PyViz.plot_index = {}\n}\n\n/**\n * Handle update_display_data messages\n */\nfunction handle_update_output(event, handle) {\n handle_clear_output(event, {cell: {output_area: handle.output_area}})\n handle_add_output(event, handle)\n}\n\nfunction register_renderer(events, OutputArea) {\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[0]);\n element.append(toinsert);\n return toinsert\n }\n\n events.on('output_added.OutputArea', handle_add_output);\n events.on('output_updated.OutputArea', handle_update_output);\n events.on('clear_output.CodeCell', handle_clear_output);\n events.on('delete.Cell', handle_clear_output);\n events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n safe: true,\n index: 0\n });\n}\n\nif (window.Jupyter !== undefined) {\n try {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n } catch(err) {\n }\n}\n" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pathlib\n", "\n", "import yaml\n", "import shutil\n", "\n", "import boa\n", "from wrapper import Wrapper" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "tags": [ "hide-cell" ] }, "outputs": [], "source": [ "# Remove old runs to have a clean slate for this example\n", "old_runs = pathlib.Path().resolve().glob(\"boa_runs*\")\n", "for path in old_runs:\n", " shutil.rmtree(path)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Loading the Config File" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "config_path = pathlib.Path().resolve() / \"single_config.yaml\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we can see what the configuration file looks like" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "# Single objective optimization config\n", "optimization_options:\n", " objective_options:\n", " objectives:\n", " - name: Cosine8\n", " trials: 50\n", " append_timestamp: False\n", "parameters:\n", " x0:\n", " type: range\n", " bounds: [0.0, 1.0]\n", " x1:\n", " type: range\n", " bounds: [0.0, 1.0]\n", " x2:\n", " type: range\n", " bounds: [0.0, 1.0]\n", " x3:\n", " type: range\n", " bounds: [0.0, 1.0]\n", " x4:\n", " type: range\n", " bounds: [0.0, 1.0]\n", " x5:\n", " type: range\n", " bounds: [0.0, 1.0]\n", " x6:\n", " type: range\n", " bounds: [0.0, 1.0]\n", " x7:\n", " type: range\n", " bounds: [0.0, 1.0]\n", "# These are all defaults, so we don't need to specify them in this case\n", "#script_options:\n", "# wrapper_path: ./wrapper.py\n", "# wrapper_name: Wrapper\n", "# working_dir: .\n", "# experiment_dir: ... # this is where boa will write logs to by default\n", " # if not specified it will be working_dir/experiment_name\n", "# append_timestamp: True\n", "# This last option appends a timestamp to our output experiment directory.\n", "# This is also the default (True)\n", "\n" ] } ], "source": [ "with open(config_path, 'r') as f:\n", " file_contents = f.read()\n", " print (file_contents)" ] }, { "cell_type": "markdown", "metadata": { "tags": [] }, "source": [ "we need the config normalized, which modifies the parameter section\n", "into a less user friendly form, but what the downstream libraries need" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "config = boa.load_jsonlike(config_path)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Define Our Wrapper" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We define our wrapper in wrapper.py and use a synthetic function that stands in for any black box model call" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "tags": [] }, "outputs": [ { "data": { "text/plain": [ "PosixPath('/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/wrapper.py')" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Wrapper.path()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "import numpy as np\n", "from ax.utils.measurement.synthetic_functions import from_botorch\n", "from botorch.test_functions.synthetic import Cosine8\n", "\n", "import boa\n", "\n", "cosine8 = from_botorch(Cosine8())\n", "\n", "\n", "def black_box_model(X) -> float:\n", " result = -cosine8(X)\n", " return result\n", "\n", "\n", "class Wrapper(boa.BaseWrapper):\n", " def __init__(self, *args, **kwargs):\n", " super().__init__(*args, **kwargs)\n", " self.data = {}\n", "\n", " def run_model(self, trial) -> None:\n", " X = np.array([parameter for parameter in trial.arm.parameters.values()])\n", " # This is a silly toy function, in reality,\n", " # you could instead import your model main() function and use that, and then collect the results.\n", " # You could also call an external script to start a model run from Bash or elsewhere.\n", " self.data[trial.index] = black_box_model(X)\n", "\n", " def set_trial_status(self, trial) -> None:\n", " data_exists = self.data.get(trial.index)\n", " if data_exists:\n", " trial.mark_completed()\n", "\n", " def fetch_trial_data(self, trial, *args, **kwargs):\n", " return self.data[trial.index]\n", "\n" ] } ], "source": [ "with open(Wrapper.path(), 'r') as f:\n", " file_contents = f.read()\n", " print (file_contents)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Initialize our Setup" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x0. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.\n", "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x1. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.\n", "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x2. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.\n", "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x3. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.\n", "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x4. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.\n", "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x5. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.\n", "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x6. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.\n", "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x7. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.\n", "[INFO 07-10 11:37:38] ax.service.utils.instantiation: Created search space: SearchSpace(parameters=[RangeParameter(name='x0', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x1', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x2', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x3', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x4', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x5', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x6', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x7', parameter_type=FLOAT, range=[0.0, 1.0])], parameter_constraints=[]).\n", "[INFO 07-10 11:37:38] ax.modelbridge.dispatch_utils: Using Models.GPEI since there are more ordered parameters than there are categories for the unordered categorical parameters.\n", "[INFO 07-10 11:37:38] ax.modelbridge.dispatch_utils: Calculating the number of remaining initialization trials based on num_initialization_trials=None max_initialization_trials=None num_tunable_parameters=8 num_trials=None use_batch_trials=False\n", "[INFO 07-10 11:37:38] ax.modelbridge.dispatch_utils: calculated num_initialization_trials=16\n", "[INFO 07-10 11:37:38] ax.modelbridge.dispatch_utils: num_completed_initialization_trials=0 num_remaining_initialization_trials=16\n", "[INFO 07-10 11:37:38] ax.modelbridge.dispatch_utils: Using Bayesian Optimization generation strategy: GenerationStrategy(name='Sobol+GPEI', steps=[Sobol for 16 trials, GPEI for subsequent trials]). Iterations after 16 will take longer to generate due to model-fitting.\n", "[INFO 07-10 11:37:38] Scheduler: `Scheduler` requires experiment to have immutable search space and optimization config. Setting property immutable_search_space_and_opt_config to `True` on experiment.\n" ] }, { "data": { "text/plain": [ "(Scheduler(experiment=Experiment(boa_runs), generation_strategy=GenerationStrategy(name='Sobol+GPEI', steps=[Sobol for 16 trials, GPEI for subsequent trials]), options=SchedulerOptions(max_pending_trials=10, trial_type=, batch_size=None, total_trials=None, tolerated_trial_failure_rate=0.5, min_failed_trials_for_failure_rate_check=5, log_filepath=None, logging_level=20, ttl_seconds_for_trials=None, init_seconds_between_polls=1, min_seconds_before_poll=1.0, seconds_between_polls_backoff_factor=1.5, timeout_hours=None, run_trials_in_batches=False, debug_log_run_metadata=False, early_stopping_strategy=None, global_stopping_strategy=None, suppress_storage_errors_after_retries=False)),\n", " )" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "controller = boa.Controller(config_path=config_path, wrapper=Wrapper)\n", "\n", "controller.initialize_scheduler()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Run our Experiment" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Controller will save our scheduler to JSON after it completes the run so we can reload it at a later time for analysis or to resume our experiment" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[INFO 2023-07-10 11:37:38,278 MainProcess] boa: \n", "\n", "##############################################\n", "\n", "\n", "BOA Experiment Run\n", "Output Experiment Dir: /Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738\n", "Start Time: 20230710T113738\n", "Version: 0.8.3.dev1+g0636f51.d20230411\n", "\n", "##############################################\n", "\n", "[INFO 07-10 11:37:38] Scheduler: Running trials [0]...\n", "[INFO 07-10 11:37:39] Scheduler: Running trials [1]...\n", "[INFO 07-10 11:37:40] Scheduler: Running trials [2]...\n", "[INFO 07-10 11:37:41] Scheduler: Running trials [3]...\n", "[INFO 07-10 11:37:41] Scheduler: Running trials [4]...\n", "[INFO 07-10 11:37:42] Scheduler: Running trials [5]...\n", "[INFO 07-10 11:37:43] Scheduler: Running trials [6]...\n", "[INFO 07-10 11:37:44] Scheduler: Running trials [7]...\n", "[INFO 07-10 11:37:45] Scheduler: Running trials [8]...\n", "[INFO 07-10 11:37:46] Scheduler: Running trials [9]...\n", "[INFO 07-10 11:37:47] Scheduler: Retrieved COMPLETED trials: 0 - 9.\n", "[INFO 07-10 11:37:47] Scheduler: Fetching data for trials: 0 - 9.\n", "[ERROR 2023-07-10 11:37:47,573 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:37:47,588 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:37:47,616 MainProcess] boa: Trials so far: 10\n", "Running trials: \n", "Will Produce next trials from generation step: Sobol\n", "Best trial so far: {1: {'Cosine8': 1.646672921687271}}\n", "[INFO 07-10 11:37:47] Scheduler: Running trials [10]...\n", "[INFO 07-10 11:37:48] Scheduler: Running trials [11]...\n", "[INFO 07-10 11:37:49] Scheduler: Running trials [12]...\n", "[INFO 07-10 11:37:50] Scheduler: Running trials [13]...\n", "[INFO 07-10 11:37:51] Scheduler: Running trials [14]...\n", "[INFO 07-10 11:37:52] Scheduler: Running trials [15]...\n", "[INFO 07-10 11:37:54] Scheduler: Running trials [16]...\n", "[INFO 07-10 11:37:56] Scheduler: Running trials [17]...\n", "[INFO 07-10 11:37:58] Scheduler: Running trials [18]...\n", "[INFO 07-10 11:37:59] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:37:59] Scheduler: Retrieved COMPLETED trials: 10 - 18.\n", "[INFO 07-10 11:37:59] Scheduler: Fetching data for trials: 10 - 18.\n", "[ERROR 2023-07-10 11:37:59,293 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:37:59,313 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:37:59,339 MainProcess] boa: Trials so far: 19\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {16: {'Cosine8': 1.47902090330447}}\n", "[INFO 07-10 11:37:59] Scheduler: Running trials [19]...\n", "[INFO 07-10 11:38:01] Scheduler: Running trials [20]...\n", "[INFO 07-10 11:38:03] Scheduler: Running trials [21]...\n", "[INFO 07-10 11:38:04] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:04] Scheduler: Retrieved COMPLETED trials: 19 - 21.\n", "[INFO 07-10 11:38:04] Scheduler: Fetching data for trials: 19 - 21.\n", "[ERROR 2023-07-10 11:38:04,536 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:04,558 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:04,584 MainProcess] boa: Trials so far: 22\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {19: {'Cosine8': 1.046563782988446}}\n", "[INFO 07-10 11:38:05] Scheduler: Running trials [22]...\n", "[INFO 07-10 11:38:06] Scheduler: Running trials [23]...\n", "[INFO 07-10 11:38:09] Scheduler: Running trials [24]...\n", "[INFO 07-10 11:38:09] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:09] Scheduler: Retrieved COMPLETED trials: 22 - 24.\n", "[INFO 07-10 11:38:09] Scheduler: Fetching data for trials: 22 - 24.\n", "[ERROR 2023-07-10 11:38:09,336 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:09,360 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:09,387 MainProcess] boa: Trials so far: 25\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {22: {'Cosine8': 0.6945835739165599}}\n", "[INFO 07-10 11:38:10] Scheduler: Running trials [25]...\n", "[INFO 07-10 11:38:12] Scheduler: Running trials [26]...\n", "[INFO 07-10 11:38:16] Scheduler: Running trials [27]...\n", "[INFO 07-10 11:38:17] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:17] Scheduler: Retrieved COMPLETED trials: 25 - 27.\n", "[INFO 07-10 11:38:17] Scheduler: Fetching data for trials: 25 - 27.\n", "[ERROR 2023-07-10 11:38:17,303 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:17,329 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:17,357 MainProcess] boa: Trials so far: 28\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {25: {'Cosine8': 0.4806960605264868}}\n", "[INFO 07-10 11:38:17] Scheduler: Running trials [28]...\n", "[INFO 07-10 11:38:20] Scheduler: Running trials [29]...\n", "[INFO 07-10 11:38:22] Scheduler: Running trials [30]...\n", "[INFO 07-10 11:38:23] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:23] Scheduler: Retrieved COMPLETED trials: 28 - 30.\n", "[INFO 07-10 11:38:23] Scheduler: Fetching data for trials: 28 - 30.\n", "[ERROR 2023-07-10 11:38:23,726 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:23,756 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:23,785 MainProcess] boa: Trials so far: 31\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {29: {'Cosine8': 0.41281812319182754}}\n", "[INFO 07-10 11:38:24] Scheduler: Running trials [31]...\n", "[INFO 07-10 11:38:25] Scheduler: Running trials [32]...\n", "[INFO 07-10 11:38:28] Scheduler: Running trials [33]...\n", "[INFO 07-10 11:38:29] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:29] Scheduler: Retrieved COMPLETED trials: 31 - 33.\n", "[INFO 07-10 11:38:29] Scheduler: Fetching data for trials: 31 - 33.\n", "[ERROR 2023-07-10 11:38:29,616 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:29,650 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:29,684 MainProcess] boa: Trials so far: 34\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {31: {'Cosine8': 0.36052556506256594}}\n", "[INFO 07-10 11:38:30] Scheduler: Running trials [34]...\n", "[INFO 07-10 11:38:31] Scheduler: Running trials [35]...\n", "[INFO 07-10 11:38:33] Scheduler: Running trials [36]...\n", "[INFO 07-10 11:38:34] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:34] Scheduler: Retrieved COMPLETED trials: 34 - 36.\n", "[INFO 07-10 11:38:34] Scheduler: Fetching data for trials: 34 - 36.\n", "[ERROR 2023-07-10 11:38:34,712 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:34,745 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:34,776 MainProcess] boa: Trials so far: 37\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {36: {'Cosine8': 0.30693978745638906}}\n", "[INFO 07-10 11:38:34] Scheduler: Running trials [37]...\n", "[INFO 07-10 11:38:36] Scheduler: Running trials [38]...\n", "[INFO 07-10 11:38:37] Scheduler: Running trials [39]...\n", "[INFO 07-10 11:38:38] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:38] Scheduler: Retrieved COMPLETED trials: 37 - 39.\n", "[INFO 07-10 11:38:38] Scheduler: Fetching data for trials: 37 - 39.\n", "[ERROR 2023-07-10 11:38:38,459 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:38,496 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:38,536 MainProcess] boa: Trials so far: 40\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {37: {'Cosine8': 0.2773584545190131}}\n", "[INFO 07-10 11:38:39] Scheduler: Running trials [40]...\n", "[INFO 07-10 11:38:40] Scheduler: Running trials [41]...\n", "[INFO 07-10 11:38:42] Scheduler: Running trials [42]...\n", "[INFO 07-10 11:38:43] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:43] Scheduler: Retrieved COMPLETED trials: 40 - 42.\n", "[INFO 07-10 11:38:43] Scheduler: Fetching data for trials: 40 - 42.\n", "[ERROR 2023-07-10 11:38:43,173 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:43,211 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:43,245 MainProcess] boa: Trials so far: 43\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {37: {'Cosine8': 0.2773584545190131}}\n", "[INFO 07-10 11:38:47] Scheduler: Running trials [43]...\n", "[INFO 07-10 11:38:48] Scheduler: Running trials [44]...\n", "[INFO 07-10 11:38:50] Scheduler: Running trials [45]...\n", "[INFO 07-10 11:38:51] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:51] Scheduler: Retrieved COMPLETED trials: 43 - 45.\n", "[INFO 07-10 11:38:51] Scheduler: Fetching data for trials: 43 - 45.\n", "[ERROR 2023-07-10 11:38:51,320 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:51,367 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:51,412 MainProcess] boa: Trials so far: 46\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {37: {'Cosine8': 0.2773584545190131}}\n", "[INFO 07-10 11:38:51] Scheduler: Running trials [46]...\n", "[INFO 07-10 11:38:53] Scheduler: Running trials [47]...\n", "[INFO 07-10 11:38:54] Scheduler: Running trials [48]...\n", "[INFO 07-10 11:38:55] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-10 11:38:55] Scheduler: Retrieved COMPLETED trials: 46 - 48.\n", "[INFO 07-10 11:38:55] Scheduler: Fetching data for trials: 46 - 48.\n", "[ERROR 2023-07-10 11:38:55,626 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:55,669 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:55,710 MainProcess] boa: Trials so far: 49\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {46: {'Cosine8': 0.24594534280361183}}\n", "/Users/madelinescyphers/miniconda3/envs/boa-dev/lib/python3.10/site-packages/botorch/optim/initializers.py:224: BadInitialCandidatesWarning: Unable to find non-zero acquisition function values - initial conditions are being selected randomly.\n", " warnings.warn(\n", "[INFO 07-10 11:38:56] Scheduler: Running trials [49]...\n", "[INFO 07-10 11:38:57] Scheduler: Retrieved COMPLETED trials: [49].\n", "[INFO 07-10 11:38:57] Scheduler: Fetching data for trials: [49].\n", "[ERROR 2023-07-10 11:38:57,314 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:57,359 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:57,400 MainProcess] boa: Trials so far: 50\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {46: {'Cosine8': 0.24594534280361183}}\n", "[ERROR 2023-07-10 11:38:57,401 MainProcess] boa: Object passed to `object_to_json` (of type , module: wrapper) is not registered with a corresponding encoder in ENCODER_REGISTRY.\n", "[INFO 2023-07-10 11:38:57,448 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738/scheduler.json`.\n", "Boa version: 0.8.3.dev1+g0636f51.d20230411\n", "[INFO 2023-07-10 11:38:57,489 MainProcess] boa: Trials so far: 50\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {46: {'Cosine8': 0.24594534280361183}}\n", "[INFO 2023-07-10 11:38:57,514 MainProcess] boa: \n", "\n", "##############################################\n", "\n", "Trials Completed!\n", "BOA Experiment Run\n", "Output Experiment Dir: /Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230710T113738\n", "Start Time: 20230710T113738\n", "Version: 0.8.3.dev1+g0636f51.d20230411\n", "End Time: 20230710T113857\n", "Total Run Time: 79.21129965782166\n", "\n", " trial_index arm_name trial_status generation_method Cosine8 x0 \\\n", "0 0 0_0 COMPLETED Sobol 2.029324 0.990547 \n", "1 1 1_0 COMPLETED Sobol 1.646673 0.262968 \n", "2 2 2_0 COMPLETED Sobol 2.144039 0.449725 \n", "3 3 3_0 COMPLETED Sobol 2.753313 0.431875 \n", "4 4 4_0 COMPLETED Sobol 3.049808 0.417872 \n", "5 5 5_0 COMPLETED Sobol 3.438582 0.895702 \n", "6 6 6_0 COMPLETED Sobol 2.069711 0.730564 \n", "7 7 7_0 COMPLETED Sobol 3.978929 0.119162 \n", "8 8 8_0 COMPLETED Sobol 2.448196 0.872235 \n", "9 9 9_0 COMPLETED Sobol 2.355544 0.286572 \n", "10 10 10_0 COMPLETED Sobol 3.009791 0.878739 \n", "11 11 11_0 COMPLETED Sobol 4.328626 0.923367 \n", "12 12 12_0 COMPLETED Sobol 1.768276 0.243641 \n", "13 13 13_0 COMPLETED Sobol 3.453395 0.687077 \n", "14 14 14_0 COMPLETED Sobol 3.690702 0.975360 \n", "15 15 15_0 COMPLETED Sobol 3.142783 0.429568 \n", "16 16 16_0 COMPLETED GPEI 1.479021 0.372412 \n", "17 17 17_0 COMPLETED GPEI 1.848654 0.133412 \n", "18 18 18_0 COMPLETED GPEI 1.719800 0.325406 \n", "19 19 19_0 COMPLETED GPEI 1.046564 0.402912 \n", "20 20 20_0 COMPLETED GPEI 1.218009 0.258951 \n", "21 21 21_0 COMPLETED GPEI 1.568101 0.481007 \n", "22 22 22_0 COMPLETED GPEI 0.694584 0.336467 \n", "23 23 23_0 COMPLETED GPEI 0.825017 0.352038 \n", "24 24 24_0 COMPLETED GPEI 1.557443 0.395534 \n", "25 25 25_0 COMPLETED GPEI 0.480696 0.315712 \n", "26 26 26_0 COMPLETED GPEI 0.666511 0.339306 \n", "27 27 27_0 COMPLETED GPEI 0.706937 0.291560 \n", "28 28 28_0 COMPLETED GPEI 0.462260 0.294458 \n", "29 29 29_0 COMPLETED GPEI 0.412818 0.381948 \n", "30 30 30_0 COMPLETED GPEI 0.779420 0.201541 \n", "31 31 31_0 COMPLETED GPEI 0.360526 0.384370 \n", "32 32 32_0 COMPLETED GPEI 0.496104 0.423386 \n", "33 33 33_0 COMPLETED GPEI 0.484507 0.316908 \n", "34 34 34_0 COMPLETED GPEI 0.511228 0.422185 \n", "35 35 35_0 COMPLETED GPEI 0.412813 0.391179 \n", "36 36 36_0 COMPLETED GPEI 0.306940 0.363556 \n", "37 37 37_0 COMPLETED GPEI 0.277358 0.347890 \n", "38 38 38_0 COMPLETED GPEI 1.136160 0.112641 \n", "39 39 39_0 COMPLETED GPEI 0.308610 0.341814 \n", "40 40 40_0 COMPLETED GPEI 0.301817 0.334515 \n", "41 41 41_0 COMPLETED GPEI 0.516885 0.264182 \n", "42 42 42_0 COMPLETED GPEI 0.343410 0.354746 \n", "43 43 43_0 COMPLETED GPEI 0.290229 0.348906 \n", "44 44 44_0 COMPLETED GPEI 0.526956 0.342680 \n", "45 45 45_0 COMPLETED GPEI 1.662781 0.399885 \n", "46 46 46_0 COMPLETED GPEI 0.245945 0.351724 \n", "47 47 47_0 COMPLETED GPEI 0.307105 0.380847 \n", "48 48 48_0 COMPLETED GPEI 0.484492 0.357150 \n", "49 49 49_0 COMPLETED GPEI 3.524827 0.675317 \n", "\n", " x1 x2 x3 x4 x5 x6 x7 \n", "0 0.288610 0.346135 0.301916 0.392528 0.110616 0.251962 0.694829 \n", "1 0.633469 0.616036 0.388401 0.427373 0.075654 0.736025 0.068805 \n", "2 0.480685 0.448159 0.548387 0.476969 0.054146 0.188638 0.978092 \n", "3 0.352470 0.052401 0.387660 0.960082 0.576974 0.864202 0.656100 \n", "4 0.647828 0.534399 0.174281 0.122930 0.771529 0.943236 0.778014 \n", "5 0.123685 0.017906 0.944492 0.357977 0.397257 0.967300 0.830473 \n", "6 0.433245 0.129033 0.007862 0.276506 0.861777 0.722698 0.493578 \n", "7 0.841748 0.990021 0.173180 0.671806 0.980801 0.351636 0.768843 \n", "8 0.815817 0.038919 0.380534 0.389911 0.711213 0.233549 0.776188 \n", "9 0.689979 0.266366 0.717407 0.132874 0.584265 0.825217 0.396867 \n", "10 0.405202 0.912348 0.580230 0.005852 0.909818 0.364704 0.253842 \n", "11 0.330759 0.834218 0.927327 0.997183 0.092835 0.869460 0.131116 \n", "12 0.347330 0.265216 0.186192 0.356840 0.319708 0.540039 0.912528 \n", "13 0.397473 0.776234 0.949205 0.041172 0.667479 0.779359 0.674563 \n", "14 0.064095 0.197106 0.757204 0.497103 0.936394 0.569573 0.615107 \n", "15 0.688117 0.034250 0.896887 0.059263 0.958642 0.881870 0.458131 \n", "16 0.593584 0.499630 0.420313 0.380171 0.086078 0.618598 0.190225 \n", "17 0.684324 0.681570 0.411335 0.436329 0.068753 0.885155 0.000000 \n", "18 0.594220 0.725250 0.252905 0.509522 0.030746 0.666139 0.000000 \n", "19 0.494737 0.378010 0.276616 0.380545 0.153921 0.527507 0.442987 \n", "20 0.508938 0.575936 0.340772 0.332884 0.000000 0.529066 0.350962 \n", "21 0.621265 0.352696 0.290243 0.383432 0.214157 0.624025 0.128180 \n", "22 0.445526 0.348530 0.228832 0.347404 0.025912 0.501000 0.434758 \n", "23 0.451447 0.468967 0.271408 0.324219 0.205404 0.402803 0.416627 \n", "24 0.549492 0.458918 0.248066 0.392106 0.047248 0.617300 0.554689 \n", "25 0.389980 0.319921 0.210277 0.304849 0.065001 0.386094 0.359033 \n", "26 0.340017 0.384153 0.180095 0.305986 0.086064 0.496477 0.330224 \n", "27 0.464385 0.268035 0.237875 0.283826 0.036284 0.310615 0.422044 \n", "28 0.372932 0.331051 0.213052 0.406540 0.045543 0.338189 0.331316 \n", "29 0.360701 0.308135 0.281827 0.271955 0.029180 0.377959 0.373382 \n", "30 0.402730 0.284366 0.215171 0.325871 0.130716 0.428317 0.285005 \n", "31 0.348921 0.333884 0.256066 0.351508 0.000000 0.323477 0.369886 \n", "32 0.378361 0.328701 0.251978 0.341967 0.000000 0.314916 0.250011 \n", "33 0.313341 0.327963 0.270480 0.343131 0.000000 0.330986 0.450200 \n", "34 0.353153 0.259158 0.230322 0.373841 0.044939 0.324527 0.406461 \n", "35 0.366165 0.387284 0.245393 0.318190 0.000000 0.297713 0.397175 \n", "36 0.368205 0.333058 0.286906 0.374388 0.000000 0.351965 0.367086 \n", "37 0.362567 0.370842 0.317156 0.376454 0.000000 0.351853 0.343095 \n", "38 0.189161 0.303689 0.489141 0.372734 0.511617 0.477609 0.238445 \n", "39 0.374499 0.338032 0.340505 0.376037 0.000000 0.299552 0.351262 \n", "40 0.340547 0.343663 0.377408 0.394207 0.000000 0.370891 0.312737 \n", "41 0.317618 0.370233 0.449533 0.350750 0.000000 0.364791 0.229735 \n", "42 0.345775 0.366915 0.346625 0.380737 0.078507 0.338985 0.337162 \n", "43 0.361392 0.379225 0.351250 0.419578 0.000000 0.344883 0.344597 \n", "44 0.344620 0.411267 0.366610 0.502446 0.000000 0.311529 0.329995 \n", "45 0.441332 0.581806 0.777294 0.626267 0.051651 0.416699 0.374300 \n", "46 0.369852 0.366687 0.389105 0.373427 0.000000 0.360029 0.356265 \n", "47 0.364766 0.371232 0.441443 0.358401 0.000000 0.356899 0.365381 \n", "48 0.284339 0.304645 0.428924 0.365574 0.001600 0.306166 0.270031 \n", "49 0.286011 0.860863 0.223397 0.281086 0.897188 0.753581 0.865855 \n", "\n", "##############################################\n", "\n" ] } ], "source": [ "scheduler = controller.run()" ] }, { "cell_type": "markdown", "metadata": { "jupyter": { "outputs_hidden": false } }, "source": [ "## Get the Best Trial and Output All Trials" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`best_fitted_trials` uses the data to do a fitting from all trials and with the noise levels you provided (or if no noise levels was provided, it assumed an unknown level of noise and inferred the noise level from the trial runs)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/madelinescyphers/miniconda3/envs/boa-dev/lib/python3.10/site-packages/botorch/models/utils/assorted.py:201: InputDataWarning: Input data is not standardized. Please consider scaling the input to zero mean and unit variance.\n", " warnings.warn(msg, InputDataWarning)\n", "/Users/madelinescyphers/miniconda3/envs/boa-dev/lib/python3.10/site-packages/botorch/models/utils/assorted.py:201: InputDataWarning: Input data is not standardized. Please consider scaling the input to zero mean and unit variance.\n", " warnings.warn(msg, InputDataWarning)\n" ] }, { "data": { "text/plain": [ "{49: {'params': {'x0': 0.35172402518319096,\n", " 'x1': 0.3698520404111157,\n", " 'x2': 0.3666874377748964,\n", " 'x3': 0.3891053518012792,\n", " 'x4': 0.3734271631500215,\n", " 'x5': 0.0,\n", " 'x6': 0.36002879332283894,\n", " 'x7': 0.35626455543974167},\n", " 'means': {'Cosine8': 0.2462324826494231},\n", " 'cov_matrix': {'Cosine8': {'Cosine8': 1.3891737938407046e-06}}}}" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trial = scheduler.best_fitted_trials()\n", "trial" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "if you need the exact points of the best trial, maybe because you need the trial number of the best trial to plot results, or for any other reason, `best_raw_trails` does not do any fitting" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{46: {'params': {'x0': 0.35172402518319096,\n", " 'x1': 0.3698520404111157,\n", " 'x2': 0.3666874377748964,\n", " 'x3': 0.3891053518012792,\n", " 'x4': 0.3734271631500215,\n", " 'x5': 0.0,\n", " 'x6': 0.36002879332283894,\n", " 'x7': 0.35626455543974167},\n", " 'means': {'Cosine8': 0.24594534280361183},\n", " 'cov_matrix': {'Cosine8': {'Cosine8': 0.0}}}}" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trial = scheduler.best_raw_trials()\n", "trial" ] }, { "cell_type": "markdown", "metadata": { "tags": [] }, "source": [ "## Output a DataFrame of All Trials" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
trial_indexarm_nametrial_statusgeneration_methodCosine8x0x1x2x3x4x5x6x7
000_0COMPLETEDSobol2.0293240.9905470.2886100.3461350.3019160.3925280.1106160.2519620.694829
111_0COMPLETEDSobol1.6466730.2629680.6334690.6160360.3884010.4273730.0756540.7360250.068805
222_0COMPLETEDSobol2.1440390.4497250.4806850.4481590.5483870.4769690.0541460.1886380.978092
333_0COMPLETEDSobol2.7533130.4318750.3524700.0524010.3876600.9600820.5769740.8642020.656100
444_0COMPLETEDSobol3.0498080.4178720.6478280.5343990.1742810.1229300.7715290.9432360.778014
555_0COMPLETEDSobol3.4385820.8957020.1236850.0179060.9444920.3579770.3972570.9673000.830473
666_0COMPLETEDSobol2.0697110.7305640.4332450.1290330.0078620.2765060.8617770.7226980.493578
777_0COMPLETEDSobol3.9789290.1191620.8417480.9900210.1731800.6718060.9808010.3516360.768843
888_0COMPLETEDSobol2.4481960.8722350.8158170.0389190.3805340.3899110.7112130.2335490.776188
999_0COMPLETEDSobol2.3555440.2865720.6899790.2663660.7174070.1328740.5842650.8252170.396867
101010_0COMPLETEDSobol3.0097910.8787390.4052020.9123480.5802300.0058520.9098180.3647040.253842
111111_0COMPLETEDSobol4.3286260.9233670.3307590.8342180.9273270.9971830.0928350.8694600.131116
121212_0COMPLETEDSobol1.7682760.2436410.3473300.2652160.1861920.3568400.3197080.5400390.912528
131313_0COMPLETEDSobol3.4533950.6870770.3974730.7762340.9492050.0411720.6674790.7793590.674563
141414_0COMPLETEDSobol3.6907020.9753600.0640950.1971060.7572040.4971030.9363940.5695730.615107
151515_0COMPLETEDSobol3.1427830.4295680.6881170.0342500.8968870.0592630.9586420.8818700.458131
161616_0COMPLETEDGPEI1.4790210.3724120.5935840.4996300.4203130.3801710.0860780.6185980.190225
171717_0COMPLETEDGPEI1.8486540.1334120.6843240.6815700.4113350.4363290.0687530.8851550.000000
181818_0COMPLETEDGPEI1.7198000.3254060.5942200.7252500.2529050.5095220.0307460.6661390.000000
191919_0COMPLETEDGPEI1.0465640.4029120.4947370.3780100.2766160.3805450.1539210.5275070.442987
202020_0COMPLETEDGPEI1.2180090.2589510.5089380.5759360.3407720.3328840.0000000.5290660.350962
212121_0COMPLETEDGPEI1.5681010.4810070.6212650.3526960.2902430.3834320.2141570.6240250.128180
222222_0COMPLETEDGPEI0.6945840.3364670.4455260.3485300.2288320.3474040.0259120.5010000.434758
232323_0COMPLETEDGPEI0.8250170.3520380.4514470.4689670.2714080.3242190.2054040.4028030.416627
242424_0COMPLETEDGPEI1.5574430.3955340.5494920.4589180.2480660.3921060.0472480.6173000.554689
252525_0COMPLETEDGPEI0.4806960.3157120.3899800.3199210.2102770.3048490.0650010.3860940.359033
262626_0COMPLETEDGPEI0.6665110.3393060.3400170.3841530.1800950.3059860.0860640.4964770.330224
272727_0COMPLETEDGPEI0.7069370.2915600.4643850.2680350.2378750.2838260.0362840.3106150.422044
282828_0COMPLETEDGPEI0.4622600.2944580.3729320.3310510.2130520.4065400.0455430.3381890.331316
292929_0COMPLETEDGPEI0.4128180.3819480.3607010.3081350.2818270.2719550.0291800.3779590.373382
303030_0COMPLETEDGPEI0.7794200.2015410.4027300.2843660.2151710.3258710.1307160.4283170.285005
313131_0COMPLETEDGPEI0.3605260.3843700.3489210.3338840.2560660.3515080.0000000.3234770.369886
323232_0COMPLETEDGPEI0.4961040.4233860.3783610.3287010.2519780.3419670.0000000.3149160.250011
333333_0COMPLETEDGPEI0.4845070.3169080.3133410.3279630.2704800.3431310.0000000.3309860.450200
343434_0COMPLETEDGPEI0.5112280.4221850.3531530.2591580.2303220.3738410.0449390.3245270.406461
353535_0COMPLETEDGPEI0.4128130.3911790.3661650.3872840.2453930.3181900.0000000.2977130.397175
363636_0COMPLETEDGPEI0.3069400.3635560.3682050.3330580.2869060.3743880.0000000.3519650.367086
373737_0COMPLETEDGPEI0.2773580.3478900.3625670.3708420.3171560.3764540.0000000.3518530.343095
383838_0COMPLETEDGPEI1.1361600.1126410.1891610.3036890.4891410.3727340.5116170.4776090.238445
393939_0COMPLETEDGPEI0.3086100.3418140.3744990.3380320.3405050.3760370.0000000.2995520.351262
404040_0COMPLETEDGPEI0.3018170.3345150.3405470.3436630.3774080.3942070.0000000.3708910.312737
414141_0COMPLETEDGPEI0.5168850.2641820.3176180.3702330.4495330.3507500.0000000.3647910.229735
424242_0COMPLETEDGPEI0.3434100.3547460.3457750.3669150.3466250.3807370.0785070.3389850.337162
434343_0COMPLETEDGPEI0.2902290.3489060.3613920.3792250.3512500.4195780.0000000.3448830.344597
444444_0COMPLETEDGPEI0.5269560.3426800.3446200.4112670.3666100.5024460.0000000.3115290.329995
454545_0COMPLETEDGPEI1.6627810.3998850.4413320.5818060.7772940.6262670.0516510.4166990.374300
464646_0COMPLETEDGPEI0.2459450.3517240.3698520.3666870.3891050.3734270.0000000.3600290.356265
474747_0COMPLETEDGPEI0.3071050.3808470.3647660.3712320.4414430.3584010.0000000.3568990.365381
484848_0COMPLETEDGPEI0.4844920.3571500.2843390.3046450.4289240.3655740.0016000.3061660.270031
494949_0COMPLETEDGPEI3.5248270.6753170.2860110.8608630.2233970.2810860.8971880.7535810.865855
\n", "
" ], "text/plain": [ " trial_index arm_name trial_status generation_method Cosine8 x0 \\\n", "0 0 0_0 COMPLETED Sobol 2.029324 0.990547 \n", "1 1 1_0 COMPLETED Sobol 1.646673 0.262968 \n", "2 2 2_0 COMPLETED Sobol 2.144039 0.449725 \n", "3 3 3_0 COMPLETED Sobol 2.753313 0.431875 \n", "4 4 4_0 COMPLETED Sobol 3.049808 0.417872 \n", "5 5 5_0 COMPLETED Sobol 3.438582 0.895702 \n", "6 6 6_0 COMPLETED Sobol 2.069711 0.730564 \n", "7 7 7_0 COMPLETED Sobol 3.978929 0.119162 \n", "8 8 8_0 COMPLETED Sobol 2.448196 0.872235 \n", "9 9 9_0 COMPLETED Sobol 2.355544 0.286572 \n", "10 10 10_0 COMPLETED Sobol 3.009791 0.878739 \n", "11 11 11_0 COMPLETED Sobol 4.328626 0.923367 \n", "12 12 12_0 COMPLETED Sobol 1.768276 0.243641 \n", "13 13 13_0 COMPLETED Sobol 3.453395 0.687077 \n", "14 14 14_0 COMPLETED Sobol 3.690702 0.975360 \n", "15 15 15_0 COMPLETED Sobol 3.142783 0.429568 \n", "16 16 16_0 COMPLETED GPEI 1.479021 0.372412 \n", "17 17 17_0 COMPLETED GPEI 1.848654 0.133412 \n", "18 18 18_0 COMPLETED GPEI 1.719800 0.325406 \n", "19 19 19_0 COMPLETED GPEI 1.046564 0.402912 \n", "20 20 20_0 COMPLETED GPEI 1.218009 0.258951 \n", "21 21 21_0 COMPLETED GPEI 1.568101 0.481007 \n", "22 22 22_0 COMPLETED GPEI 0.694584 0.336467 \n", "23 23 23_0 COMPLETED GPEI 0.825017 0.352038 \n", "24 24 24_0 COMPLETED GPEI 1.557443 0.395534 \n", "25 25 25_0 COMPLETED GPEI 0.480696 0.315712 \n", "26 26 26_0 COMPLETED GPEI 0.666511 0.339306 \n", "27 27 27_0 COMPLETED GPEI 0.706937 0.291560 \n", "28 28 28_0 COMPLETED GPEI 0.462260 0.294458 \n", "29 29 29_0 COMPLETED GPEI 0.412818 0.381948 \n", "30 30 30_0 COMPLETED GPEI 0.779420 0.201541 \n", "31 31 31_0 COMPLETED GPEI 0.360526 0.384370 \n", "32 32 32_0 COMPLETED GPEI 0.496104 0.423386 \n", "33 33 33_0 COMPLETED GPEI 0.484507 0.316908 \n", "34 34 34_0 COMPLETED GPEI 0.511228 0.422185 \n", "35 35 35_0 COMPLETED GPEI 0.412813 0.391179 \n", "36 36 36_0 COMPLETED GPEI 0.306940 0.363556 \n", "37 37 37_0 COMPLETED GPEI 0.277358 0.347890 \n", "38 38 38_0 COMPLETED GPEI 1.136160 0.112641 \n", "39 39 39_0 COMPLETED GPEI 0.308610 0.341814 \n", "40 40 40_0 COMPLETED GPEI 0.301817 0.334515 \n", "41 41 41_0 COMPLETED GPEI 0.516885 0.264182 \n", "42 42 42_0 COMPLETED GPEI 0.343410 0.354746 \n", "43 43 43_0 COMPLETED GPEI 0.290229 0.348906 \n", "44 44 44_0 COMPLETED GPEI 0.526956 0.342680 \n", "45 45 45_0 COMPLETED GPEI 1.662781 0.399885 \n", "46 46 46_0 COMPLETED GPEI 0.245945 0.351724 \n", "47 47 47_0 COMPLETED GPEI 0.307105 0.380847 \n", "48 48 48_0 COMPLETED GPEI 0.484492 0.357150 \n", "49 49 49_0 COMPLETED GPEI 3.524827 0.675317 \n", "\n", " x1 x2 x3 x4 x5 x6 x7 \n", "0 0.288610 0.346135 0.301916 0.392528 0.110616 0.251962 0.694829 \n", "1 0.633469 0.616036 0.388401 0.427373 0.075654 0.736025 0.068805 \n", "2 0.480685 0.448159 0.548387 0.476969 0.054146 0.188638 0.978092 \n", "3 0.352470 0.052401 0.387660 0.960082 0.576974 0.864202 0.656100 \n", "4 0.647828 0.534399 0.174281 0.122930 0.771529 0.943236 0.778014 \n", "5 0.123685 0.017906 0.944492 0.357977 0.397257 0.967300 0.830473 \n", "6 0.433245 0.129033 0.007862 0.276506 0.861777 0.722698 0.493578 \n", "7 0.841748 0.990021 0.173180 0.671806 0.980801 0.351636 0.768843 \n", "8 0.815817 0.038919 0.380534 0.389911 0.711213 0.233549 0.776188 \n", "9 0.689979 0.266366 0.717407 0.132874 0.584265 0.825217 0.396867 \n", "10 0.405202 0.912348 0.580230 0.005852 0.909818 0.364704 0.253842 \n", "11 0.330759 0.834218 0.927327 0.997183 0.092835 0.869460 0.131116 \n", "12 0.347330 0.265216 0.186192 0.356840 0.319708 0.540039 0.912528 \n", "13 0.397473 0.776234 0.949205 0.041172 0.667479 0.779359 0.674563 \n", "14 0.064095 0.197106 0.757204 0.497103 0.936394 0.569573 0.615107 \n", "15 0.688117 0.034250 0.896887 0.059263 0.958642 0.881870 0.458131 \n", "16 0.593584 0.499630 0.420313 0.380171 0.086078 0.618598 0.190225 \n", "17 0.684324 0.681570 0.411335 0.436329 0.068753 0.885155 0.000000 \n", "18 0.594220 0.725250 0.252905 0.509522 0.030746 0.666139 0.000000 \n", "19 0.494737 0.378010 0.276616 0.380545 0.153921 0.527507 0.442987 \n", "20 0.508938 0.575936 0.340772 0.332884 0.000000 0.529066 0.350962 \n", "21 0.621265 0.352696 0.290243 0.383432 0.214157 0.624025 0.128180 \n", "22 0.445526 0.348530 0.228832 0.347404 0.025912 0.501000 0.434758 \n", "23 0.451447 0.468967 0.271408 0.324219 0.205404 0.402803 0.416627 \n", "24 0.549492 0.458918 0.248066 0.392106 0.047248 0.617300 0.554689 \n", "25 0.389980 0.319921 0.210277 0.304849 0.065001 0.386094 0.359033 \n", "26 0.340017 0.384153 0.180095 0.305986 0.086064 0.496477 0.330224 \n", "27 0.464385 0.268035 0.237875 0.283826 0.036284 0.310615 0.422044 \n", "28 0.372932 0.331051 0.213052 0.406540 0.045543 0.338189 0.331316 \n", "29 0.360701 0.308135 0.281827 0.271955 0.029180 0.377959 0.373382 \n", "30 0.402730 0.284366 0.215171 0.325871 0.130716 0.428317 0.285005 \n", "31 0.348921 0.333884 0.256066 0.351508 0.000000 0.323477 0.369886 \n", "32 0.378361 0.328701 0.251978 0.341967 0.000000 0.314916 0.250011 \n", "33 0.313341 0.327963 0.270480 0.343131 0.000000 0.330986 0.450200 \n", "34 0.353153 0.259158 0.230322 0.373841 0.044939 0.324527 0.406461 \n", "35 0.366165 0.387284 0.245393 0.318190 0.000000 0.297713 0.397175 \n", "36 0.368205 0.333058 0.286906 0.374388 0.000000 0.351965 0.367086 \n", "37 0.362567 0.370842 0.317156 0.376454 0.000000 0.351853 0.343095 \n", "38 0.189161 0.303689 0.489141 0.372734 0.511617 0.477609 0.238445 \n", "39 0.374499 0.338032 0.340505 0.376037 0.000000 0.299552 0.351262 \n", "40 0.340547 0.343663 0.377408 0.394207 0.000000 0.370891 0.312737 \n", "41 0.317618 0.370233 0.449533 0.350750 0.000000 0.364791 0.229735 \n", "42 0.345775 0.366915 0.346625 0.380737 0.078507 0.338985 0.337162 \n", "43 0.361392 0.379225 0.351250 0.419578 0.000000 0.344883 0.344597 \n", "44 0.344620 0.411267 0.366610 0.502446 0.000000 0.311529 0.329995 \n", "45 0.441332 0.581806 0.777294 0.626267 0.051651 0.416699 0.374300 \n", "46 0.369852 0.366687 0.389105 0.373427 0.000000 0.360029 0.356265 \n", "47 0.364766 0.371232 0.441443 0.358401 0.000000 0.356899 0.365381 \n", "48 0.284339 0.304645 0.428924 0.365574 0.001600 0.306166 0.270031 \n", "49 0.286011 0.860863 0.223397 0.281086 0.897188 0.753581 0.865855 " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "boa.scheduler_to_df(scheduler)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.9" }, "vscode": { "interpreter": { "hash": "e4753ff389e29e439da2b5f976c0c752a36b29db5d37953ba5fa1bffb26df317" } } }, "nbformat": 4, "nbformat_minor": 4 }