{ "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": [ { "name": "stderr", "output_type": "stream", "text": [ "[WARNING 07-13 14:30:51] ax.service.utils.with_db_settings_base: Ax currently requires a sqlalchemy version below 2.0. This will be addressed in a future release. Disabling SQL storage in Ax for now, if you would like to use SQL storage please install Ax with mysql extras via `pip install ax-platform[mysql]`.\n" ] }, { "data": { "application/javascript": [ "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", " var py_version = '3.2.0'.replace('rc', '-rc.').replace('.dev', '-dev.');\n", " var is_dev = py_version.indexOf(\"+\") !== -1 || py_version.indexOf(\"-\") !== -1;\n", " var reloading = false;\n", " var Bokeh = root.Bokeh;\n", " var bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n", "\n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force) {\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, js_exports, callback) {\n", " if (css_urls == null) css_urls = [];\n", " if (js_urls == null) js_urls = [];\n", " if (js_modules == null) js_modules = [];\n", " if (js_exports == null) js_exports = {};\n", "\n", " root._bokeh_onload_callbacks.push(callback);\n", "\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 && Object.keys(js_exports).length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " if (!reloading) {\n", " console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " }\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", " window._bokeh_on_load = on_load\n", "\n", " function on_error() {\n", " console.error(\"failed to load \" + url);\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', 'jspanel': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/jspanel', 'jspanel-modal': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/modal/jspanel.modal', 'jspanel-tooltip': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/tooltip/jspanel.tooltip', 'jspanel-hint': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/hint/jspanel.hint', 'jspanel-layout': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/layout/jspanel.layout', 'jspanel-contextmenu': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/contextmenu/jspanel.contextmenu', 'jspanel-dock': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/dock/jspanel.dock', 'gridstack': 'https://cdn.jsdelivr.net/npm/gridstack@7.2.3/dist/gridstack-all', 'notyf': 'https://cdn.jsdelivr.net/npm/notyf@3/notyf.min'}, 'shim': {'jspanel': {'exports': 'jsPanel'}, 'gridstack': {'exports': 'GridStack'}}});\n", " require([\"plotly\"], function(Plotly) {\n", "\twindow.Plotly = Plotly\n", "\ton_load()\n", " })\n", " require([\"jspanel\"], function(jsPanel) {\n", "\twindow.jsPanel = jsPanel\n", "\ton_load()\n", " })\n", " require([\"jspanel-modal\"], function() {\n", "\ton_load()\n", " })\n", " require([\"jspanel-tooltip\"], function() {\n", "\ton_load()\n", " })\n", " require([\"jspanel-hint\"], function() {\n", "\ton_load()\n", " })\n", " require([\"jspanel-layout\"], function() {\n", "\ton_load()\n", " })\n", " require([\"jspanel-contextmenu\"], function() {\n", "\ton_load()\n", " })\n", " require([\"jspanel-dock\"], function() {\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 + 10;\n", " } else {\n", " root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length + Object.keys(js_exports).length;\n", " }\n", "\n", " var existing_stylesheets = []\n", " var links = document.getElementsByTagName('link')\n", " for (var i = 0; i < links.length; i++) {\n", " var link = links[i]\n", " if (link.href != null) {\n", "\texisting_stylesheets.push(link.href)\n", " }\n", " }\n", " for (var i = 0; i < css_urls.length; i++) {\n", " var url = css_urls[i];\n", " if (existing_stylesheets.indexOf(url) !== -1) {\n", "\ton_load()\n", "\tcontinue;\n", " }\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", " } if (((window['Plotly'] !== undefined) && (!(window['Plotly'] instanceof HTMLElement))) || window.requirejs) {\n", " var urls = ['https://cdn.holoviz.org/panel/1.2.0/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['jsPanel'] !== undefined) && (!(window['jsPanel'] instanceof HTMLElement))) || window.requirejs) {\n", " var urls = ['https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/jspanel.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/modal/jspanel.modal.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/tooltip/jspanel.tooltip.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/hint/jspanel.hint.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/layout/jspanel.layout.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/contextmenu/jspanel.contextmenu.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/dock/jspanel.dock.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/1.2.0/dist/bundled/gridstack/gridstack@7.2.3/dist/gridstack-all.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/1.2.0/dist/bundled/notificationarea/notyf@3/notyf.min.js'];\n", " for (var i = 0; i < urls.length; i++) {\n", " skip.push(urls[i])\n", " }\n", " } var existing_scripts = []\n", " var scripts = document.getElementsByTagName('script')\n", " for (var i = 0; i < scripts.length; i++) {\n", " var script = scripts[i]\n", " if (script.src != null) {\n", "\texisting_scripts.push(script.src)\n", " }\n", " }\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\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) !== -1 || existing_scripts.indexOf(url) !== -1) {\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", " for (const name in js_exports) {\n", " var url = js_exports[name];\n", " if (skip.indexOf(url) >= 0 || root[name] != null) {\n", "\tif (!window.requirejs) {\n", "\t on_load();\n", "\t}\n", "\tcontinue;\n", " }\n", " var element = document.createElement('script');\n", " element.onerror = on_error;\n", " element.async = false;\n", " element.type = \"module\";\n", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " element.textContent = `\n", " import ${name} from \"${url}\"\n", " window.${name} = ${name}\n", " window._bokeh_on_load()\n", " `\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/1.2.0/dist/bundled/jquery/jquery.slim.min.js\", \"https://cdn.holoviz.org/panel/1.2.0/dist/bundled/plotlyplot/plotly-2.18.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-3.2.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.2.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.2.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.2.0.min.js\", \"https://cdn.holoviz.org/panel/1.2.0/dist/panel.min.js\"];\n", " var js_modules = [];\n", " var js_exports = {};\n", " var css_urls = [];\n", " var inline_js = [ 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", " }\n", " // Cache old bokeh versions\n", " if (Bokeh != undefined && !reloading) {\n", "\tvar NewBokeh = root.Bokeh;\n", "\tif (Bokeh.versions === undefined) {\n", "\t Bokeh.versions = new Map();\n", "\t}\n", "\tif (NewBokeh.version !== Bokeh.version) {\n", "\t Bokeh.versions.set(NewBokeh.version, NewBokeh)\n", "\t}\n", "\troot.Bokeh = 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", " root._bokeh_is_initializing = false\n", " }\n", "\n", " function load_or_wait() {\n", " // Implement a backoff loop that tries to ensure we do not load multiple\n", " // versions of Bokeh and its dependencies at the same time.\n", " // In recent versions we use the root._bokeh_is_initializing flag\n", " // to determine whether there is an ongoing attempt to initialize\n", " // bokeh, however for backward compatibility we also try to ensure\n", " // that we do not start loading a newer (Panel>=1.0 and Bokeh>3) version\n", " // before older versions are fully initialized.\n", " if (root._bokeh_is_initializing && Date.now() > root._bokeh_timeout) {\n", " root._bokeh_is_initializing = false;\n", " root._bokeh_onload_callbacks = undefined;\n", " console.log(\"Bokeh: BokehJS was loaded multiple times but one version failed to initialize.\");\n", " load_or_wait();\n", " } else if (root._bokeh_is_initializing || (typeof root._bokeh_is_initializing === \"undefined\" && root._bokeh_onload_callbacks !== undefined)) {\n", " setTimeout(load_or_wait, 100);\n", " } else {\n", " Bokeh = root.Bokeh;\n", " bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n", " root._bokeh_is_initializing = true\n", " root._bokeh_onload_callbacks = []\n", " if (!reloading && (!bokeh_loaded || is_dev)) {\n", "\troot.Bokeh = undefined;\n", " }\n", " load_libs(css_urls, js_urls, js_modules, js_exports, function() {\n", "\tconsole.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n", "\trun_inline_js();\n", " });\n", " }\n", " }\n", " // Give older versions of the autoload script a head-start to ensure\n", " // they initialize before we start loading newer version.\n", " setTimeout(load_or_wait, 100)\n", "}(window));" ], "application/vnd.holoviews_load.v0+json": "(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n var py_version = '3.2.0'.replace('rc', '-rc.').replace('.dev', '-dev.');\n var is_dev = py_version.indexOf(\"+\") !== -1 || py_version.indexOf(\"-\") !== -1;\n var reloading = false;\n var Bokeh = root.Bokeh;\n var bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n\n if (typeof (root._bokeh_timeout) === \"undefined\" || force) {\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, js_exports, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n if (js_modules == null) js_modules = [];\n if (js_exports == null) js_exports = {};\n\n root._bokeh_onload_callbacks.push(callback);\n\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 && Object.keys(js_exports).length === 0) {\n run_callbacks();\n return null;\n }\n if (!reloading) {\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n }\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 window._bokeh_on_load = on_load\n\n function on_error() {\n console.error(\"failed to load \" + url);\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', 'jspanel': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/jspanel', 'jspanel-modal': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/modal/jspanel.modal', 'jspanel-tooltip': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/tooltip/jspanel.tooltip', 'jspanel-hint': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/hint/jspanel.hint', 'jspanel-layout': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/layout/jspanel.layout', 'jspanel-contextmenu': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/contextmenu/jspanel.contextmenu', 'jspanel-dock': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/dock/jspanel.dock', 'gridstack': 'https://cdn.jsdelivr.net/npm/gridstack@7.2.3/dist/gridstack-all', 'notyf': 'https://cdn.jsdelivr.net/npm/notyf@3/notyf.min'}, 'shim': {'jspanel': {'exports': 'jsPanel'}, 'gridstack': {'exports': 'GridStack'}}});\n require([\"plotly\"], function(Plotly) {\n\twindow.Plotly = Plotly\n\ton_load()\n })\n require([\"jspanel\"], function(jsPanel) {\n\twindow.jsPanel = jsPanel\n\ton_load()\n })\n require([\"jspanel-modal\"], function() {\n\ton_load()\n })\n require([\"jspanel-tooltip\"], function() {\n\ton_load()\n })\n require([\"jspanel-hint\"], function() {\n\ton_load()\n })\n require([\"jspanel-layout\"], function() {\n\ton_load()\n })\n require([\"jspanel-contextmenu\"], function() {\n\ton_load()\n })\n require([\"jspanel-dock\"], function() {\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 + 10;\n } else {\n root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length + Object.keys(js_exports).length;\n }\n\n var existing_stylesheets = []\n var links = document.getElementsByTagName('link')\n for (var i = 0; i < links.length; i++) {\n var link = links[i]\n if (link.href != null) {\n\texisting_stylesheets.push(link.href)\n }\n }\n for (var i = 0; i < css_urls.length; i++) {\n var url = css_urls[i];\n if (existing_stylesheets.indexOf(url) !== -1) {\n\ton_load()\n\tcontinue;\n }\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 } if (((window['Plotly'] !== undefined) && (!(window['Plotly'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/1.2.0/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['jsPanel'] !== undefined) && (!(window['jsPanel'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/jspanel.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/modal/jspanel.modal.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/tooltip/jspanel.tooltip.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/hint/jspanel.hint.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/layout/jspanel.layout.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/contextmenu/jspanel.contextmenu.js', 'https://cdn.holoviz.org/panel/1.2.0/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/dock/jspanel.dock.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/1.2.0/dist/bundled/gridstack/gridstack@7.2.3/dist/gridstack-all.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/1.2.0/dist/bundled/notificationarea/notyf@3/notyf.min.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } var existing_scripts = []\n var scripts = document.getElementsByTagName('script')\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i]\n if (script.src != null) {\n\texisting_scripts.push(script.src)\n }\n }\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\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) !== -1 || existing_scripts.indexOf(url) !== -1) {\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 for (const name in js_exports) {\n var url = js_exports[name];\n if (skip.indexOf(url) >= 0 || root[name] != null) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onerror = on_error;\n element.async = false;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n element.textContent = `\n import ${name} from \"${url}\"\n window.${name} = ${name}\n window._bokeh_on_load()\n `\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/1.2.0/dist/bundled/jquery/jquery.slim.min.js\", \"https://cdn.holoviz.org/panel/1.2.0/dist/bundled/plotlyplot/plotly-2.18.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-3.2.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.2.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.2.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.2.0.min.js\", \"https://cdn.holoviz.org/panel/1.2.0/dist/panel.min.js\"];\n var js_modules = [];\n var js_exports = {};\n var css_urls = [];\n var inline_js = [ 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 }\n // Cache old bokeh versions\n if (Bokeh != undefined && !reloading) {\n\tvar NewBokeh = root.Bokeh;\n\tif (Bokeh.versions === undefined) {\n\t Bokeh.versions = new Map();\n\t}\n\tif (NewBokeh.version !== Bokeh.version) {\n\t Bokeh.versions.set(NewBokeh.version, NewBokeh)\n\t}\n\troot.Bokeh = 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 root._bokeh_is_initializing = false\n }\n\n function load_or_wait() {\n // Implement a backoff loop that tries to ensure we do not load multiple\n // versions of Bokeh and its dependencies at the same time.\n // In recent versions we use the root._bokeh_is_initializing flag\n // to determine whether there is an ongoing attempt to initialize\n // bokeh, however for backward compatibility we also try to ensure\n // that we do not start loading a newer (Panel>=1.0 and Bokeh>3) version\n // before older versions are fully initialized.\n if (root._bokeh_is_initializing && Date.now() > root._bokeh_timeout) {\n root._bokeh_is_initializing = false;\n root._bokeh_onload_callbacks = undefined;\n console.log(\"Bokeh: BokehJS was loaded multiple times but one version failed to initialize.\");\n load_or_wait();\n } else if (root._bokeh_is_initializing || (typeof root._bokeh_is_initializing === \"undefined\" && root._bokeh_onload_callbacks !== undefined)) {\n setTimeout(load_or_wait, 100);\n } else {\n Bokeh = root.Bokeh;\n bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n root._bokeh_is_initializing = true\n root._bokeh_onload_callbacks = []\n if (!reloading && (!bokeh_loaded || is_dev)) {\n\troot.Bokeh = undefined;\n }\n load_libs(css_urls, js_urls, js_modules, js_exports, function() {\n\tconsole.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n\trun_inline_js();\n });\n }\n }\n // Give older versions of the autoload script a head-start to ensure\n // they initialize before we start loading newer version.\n setTimeout(load_or_wait, 100)\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" }, { "data": { "application/vnd.holoviews_exec.v0+json": "", "text/html": [ "
\n", "
\n", "
\n", "" ] }, "metadata": { "application/vnd.holoviews_exec.v0+json": { "id": "e80c2d14-6efb-4a32-aaa2-7e3103843e9e" } }, "output_type": "display_data" } ], "source": [ "import pathlib\n", "import shutil\n", "\n", "from IPython.display import Code\n", "from wrapper import Wrapper\n", "\n", "import boa" ] }, { "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": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
# 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" ], "text/latex": [ "\\begin{Verbatim}[commandchars=\\\\\\{\\}]\n", "\\PY{c+c1}{\\PYZsh{} Single objective optimization config}\n", "\\PY{n+nt}{optimization\\PYZus{}options}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{objective\\PYZus{}options}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{objectives}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{p+pIndicator}{\\PYZhy{}}\\PY{+w}{ }\\PY{n+nt}{name}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{Cosine8}\n", "\\PY{+w}{ }\\PY{n+nt}{trials}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{50}\n", "\\PY{+w}{ }\\PY{n+nt}{append\\PYZus{}timestamp}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{False}\n", "\\PY{n+nt}{parameters}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{x0}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{type}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{range}\n", "\\PY{+w}{ }\\PY{n+nt}{bounds}\\PY{p}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{n+nv}{0.0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1.0}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{n+nt}{x1}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{type}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{range}\n", "\\PY{+w}{ }\\PY{n+nt}{bounds}\\PY{p}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{n+nv}{0.0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1.0}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{n+nt}{x2}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{type}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{range}\n", "\\PY{+w}{ }\\PY{n+nt}{bounds}\\PY{p}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{n+nv}{0.0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1.0}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{n+nt}{x3}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{type}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{range}\n", "\\PY{+w}{ }\\PY{n+nt}{bounds}\\PY{p}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{n+nv}{0.0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1.0}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{n+nt}{x4}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{type}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{range}\n", "\\PY{+w}{ }\\PY{n+nt}{bounds}\\PY{p}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{n+nv}{0.0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1.0}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{n+nt}{x5}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{type}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{range}\n", "\\PY{+w}{ }\\PY{n+nt}{bounds}\\PY{p}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{n+nv}{0.0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1.0}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{n+nt}{x6}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{type}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{range}\n", "\\PY{+w}{ }\\PY{n+nt}{bounds}\\PY{p}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{n+nv}{0.0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1.0}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{n+nt}{x7}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{type}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{range}\n", "\\PY{+w}{ }\\PY{n+nt}{bounds}\\PY{p}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{n+nv}{0.0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1.0}\\PY{p+pIndicator}{]}\n", "\\PY{c+c1}{\\PYZsh{} These are all defaults, so we don\\PYZsq{}t need to specify them in this case}\n", "\\PY{c+c1}{\\PYZsh{}script\\PYZus{}options:}\n", "\\PY{c+c1}{\\PYZsh{} wrapper\\PYZus{}path: ./wrapper.py}\n", "\\PY{c+c1}{\\PYZsh{} wrapper\\PYZus{}name: Wrapper}\n", "\\PY{c+c1}{\\PYZsh{} working\\PYZus{}dir: .}\n", "\\PY{c+c1}{\\PYZsh{} experiment\\PYZus{}dir: ... \\PYZsh{} this is where boa will write logs to by default}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} if not specified it will be working\\PYZus{}dir/experiment\\PYZus{}name}\n", "\\PY{c+c1}{\\PYZsh{} append\\PYZus{}timestamp: True}\n", "\\PY{c+c1}{\\PYZsh{} This last option appends a timestamp to our output experiment directory.}\n", "\\PY{c+c1}{\\PYZsh{} This is also the default (True)}\n", "\\end{Verbatim}\n" ], "text/plain": [ "# 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)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Code(config_path)" ] }, { "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/html": [ "
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" ], "text/latex": [ "\\begin{Verbatim}[commandchars=\\\\\\{\\}]\n", "\\PY{k+kn}{import} \\PY{n+nn}{numpy} \\PY{k}{as} \\PY{n+nn}{np}\n", "\\PY{k+kn}{from} \\PY{n+nn}{ax}\\PY{n+nn}{.}\\PY{n+nn}{utils}\\PY{n+nn}{.}\\PY{n+nn}{measurement}\\PY{n+nn}{.}\\PY{n+nn}{synthetic\\PYZus{}functions} \\PY{k+kn}{import} \\PY{n}{from\\PYZus{}botorch}\n", "\\PY{k+kn}{from} \\PY{n+nn}{botorch}\\PY{n+nn}{.}\\PY{n+nn}{test\\PYZus{}functions}\\PY{n+nn}{.}\\PY{n+nn}{synthetic} \\PY{k+kn}{import} \\PY{n}{Cosine8}\n", "\n", "\\PY{k+kn}{import} \\PY{n+nn}{boa}\n", "\n", "\\PY{n}{cosine8} \\PY{o}{=} \\PY{n}{from\\PYZus{}botorch}\\PY{p}{(}\\PY{n}{Cosine8}\\PY{p}{(}\\PY{p}{)}\\PY{p}{)}\n", "\n", "\n", "\\PY{k}{def} \\PY{n+nf}{black\\PYZus{}box\\PYZus{}model}\\PY{p}{(}\\PY{n}{X}\\PY{p}{)} \\PY{o}{\\PYZhy{}}\\PY{o}{\\PYZgt{}} \\PY{n+nb}{float}\\PY{p}{:}\n", " \\PY{n}{result} \\PY{o}{=} \\PY{o}{\\PYZhy{}}\\PY{n}{cosine8}\\PY{p}{(}\\PY{n}{X}\\PY{p}{)}\n", " \\PY{k}{return} \\PY{n}{result}\n", "\n", "\n", "\\PY{k}{class} \\PY{n+nc}{Wrapper}\\PY{p}{(}\\PY{n}{boa}\\PY{o}{.}\\PY{n}{BaseWrapper}\\PY{p}{)}\\PY{p}{:}\n", " \\PY{k}{def} \\PY{n+nf+fm}{\\PYZus{}\\PYZus{}init\\PYZus{}\\PYZus{}}\\PY{p}{(}\\PY{n+nb+bp}{self}\\PY{p}{,} \\PY{o}{*}\\PY{n}{args}\\PY{p}{,} \\PY{o}{*}\\PY{o}{*}\\PY{n}{kwargs}\\PY{p}{)}\\PY{p}{:}\n", " \\PY{n+nb}{super}\\PY{p}{(}\\PY{p}{)}\\PY{o}{.}\\PY{n+nf+fm}{\\PYZus{}\\PYZus{}init\\PYZus{}\\PYZus{}}\\PY{p}{(}\\PY{o}{*}\\PY{n}{args}\\PY{p}{,} \\PY{o}{*}\\PY{o}{*}\\PY{n}{kwargs}\\PY{p}{)}\n", " \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{data} \\PY{o}{=} \\PY{p}{\\PYZob{}}\\PY{p}{\\PYZcb{}}\n", "\n", " \\PY{k}{def} \\PY{n+nf}{run\\PYZus{}model}\\PY{p}{(}\\PY{n+nb+bp}{self}\\PY{p}{,} \\PY{n}{trial}\\PY{p}{)} \\PY{o}{\\PYZhy{}}\\PY{o}{\\PYZgt{}} \\PY{k+kc}{None}\\PY{p}{:}\n", " \\PY{n}{X} \\PY{o}{=} \\PY{n}{np}\\PY{o}{.}\\PY{n}{array}\\PY{p}{(}\\PY{p}{[}\\PY{n}{parameter} \\PY{k}{for} \\PY{n}{parameter} \\PY{o+ow}{in} \\PY{n}{trial}\\PY{o}{.}\\PY{n}{arm}\\PY{o}{.}\\PY{n}{parameters}\\PY{o}{.}\\PY{n}{values}\\PY{p}{(}\\PY{p}{)}\\PY{p}{]}\\PY{p}{)}\n", " \\PY{c+c1}{\\PYZsh{} This is a silly toy function, in reality,}\n", " \\PY{c+c1}{\\PYZsh{} you could instead import your model main() function and use that, and then collect the results.}\n", " \\PY{c+c1}{\\PYZsh{} You could also call an external script to start a model run from Bash or elsewhere.}\n", " \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{data}\\PY{p}{[}\\PY{n}{trial}\\PY{o}{.}\\PY{n}{index}\\PY{p}{]} \\PY{o}{=} \\PY{n}{black\\PYZus{}box\\PYZus{}model}\\PY{p}{(}\\PY{n}{X}\\PY{p}{)}\n", "\n", " \\PY{k}{def} \\PY{n+nf}{set\\PYZus{}trial\\PYZus{}status}\\PY{p}{(}\\PY{n+nb+bp}{self}\\PY{p}{,} \\PY{n}{trial}\\PY{p}{)} \\PY{o}{\\PYZhy{}}\\PY{o}{\\PYZgt{}} \\PY{k+kc}{None}\\PY{p}{:}\n", " \\PY{n}{data\\PYZus{}exists} \\PY{o}{=} \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{data}\\PY{o}{.}\\PY{n}{get}\\PY{p}{(}\\PY{n}{trial}\\PY{o}{.}\\PY{n}{index}\\PY{p}{)}\n", " \\PY{k}{if} \\PY{n}{data\\PYZus{}exists}\\PY{p}{:}\n", " \\PY{n}{trial}\\PY{o}{.}\\PY{n}{mark\\PYZus{}completed}\\PY{p}{(}\\PY{p}{)}\n", "\n", " \\PY{k}{def} \\PY{n+nf}{fetch\\PYZus{}trial\\PYZus{}data}\\PY{p}{(}\\PY{n+nb+bp}{self}\\PY{p}{,} \\PY{n}{trial}\\PY{p}{,} \\PY{o}{*}\\PY{n}{args}\\PY{p}{,} \\PY{o}{*}\\PY{o}{*}\\PY{n}{kwargs}\\PY{p}{)}\\PY{p}{:}\n", " \\PY{k}{return} \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{data}\\PY{p}{[}\\PY{n}{trial}\\PY{o}{.}\\PY{n}{index}\\PY{p}{]}\n", "\\end{Verbatim}\n" ], "text/plain": [ "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]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Code(Wrapper.path())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Initialize our Setup" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[INFO 07-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] 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-13 14:30:53] ax.modelbridge.dispatch_utils: calculated num_initialization_trials=16\n", "[INFO 07-13 14:30:53] ax.modelbridge.dispatch_utils: num_completed_initialization_trials=0 num_remaining_initialization_trials=16\n", "[INFO 07-13 14:30:53] 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-13 14:30:53] 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": 7, "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": 8, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[INFO 2023-07-13 14:30:53,587 MainProcess] boa: \n", "\n", "##############################################\n", "\n", "\n", "BOA Experiment Run\n", "Output Experiment Dir: /Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053\n", "Start Time: 20230713T143053\n", "Version: 0.8.7.dev4+gae30cf2.d20230713\n", "\n", "##############################################\n", "\n", "[INFO 07-13 14:30:53] Scheduler: Running trials [0]...\n", "[INFO 07-13 14:30:54] Scheduler: Running trials [1]...\n", "[INFO 07-13 14:30:55] Scheduler: Running trials [2]...\n", "[INFO 07-13 14:30:56] Scheduler: Running trials [3]...\n", "[INFO 07-13 14:30:57] Scheduler: Running trials [4]...\n", "[INFO 07-13 14:30:58] Scheduler: Running trials [5]...\n", "[INFO 07-13 14:30:59] Scheduler: Running trials [6]...\n", "[INFO 07-13 14:31:00] Scheduler: Running trials [7]...\n", "[INFO 07-13 14:31:01] Scheduler: Running trials [8]...\n", "[INFO 07-13 14:31:01] Scheduler: Running trials [9]...\n", "[INFO 07-13 14:31:02] Scheduler: Retrieved COMPLETED trials: 0 - 9.\n", "[INFO 07-13 14:31:02] Scheduler: Fetching data for trials: 0 - 9.\n", "[ERROR 2023-07-13 14:31:03,260 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-13 14:31:03,376 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:03,518 MainProcess] boa: Trials so far: 10\n", "Running trials: \n", "Will Produce next trials from generation step: Sobol\n", "Best trial so far: {2: {'Cosine8': 1.8380990235708126}}\n", "[INFO 07-13 14:31:03] Scheduler: Running trials [10]...\n", "[INFO 07-13 14:31:04] Scheduler: Running trials [11]...\n", "[INFO 07-13 14:31:05] Scheduler: Running trials [12]...\n", "[INFO 07-13 14:31:05] Scheduler: Running trials [13]...\n", "[INFO 07-13 14:31:06] Scheduler: Running trials [14]...\n", "[INFO 07-13 14:31:06] Scheduler: Running trials [15]...\n", "[INFO 07-13 14:31:10] Scheduler: Running trials [16]...\n", "[INFO 07-13 14:31:11] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:12] Scheduler: Running trials [17]...\n", "[INFO 07-13 14:31:13] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:15] Scheduler: Running trials [18]...\n", "[INFO 07-13 14:31:16] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:16] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:31:16] Scheduler: Retrieved COMPLETED trials: 10 - 18.\n", "[INFO 07-13 14:31:16] Scheduler: Fetching data for trials: 10 - 18.\n", "[ERROR 2023-07-13 14:31:16,483 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-13 14:31:16,556 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:16,616 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.5766326240667596}}\n", "[INFO 07-13 14:31:17] Scheduler: Running trials [19]...\n", "[INFO 07-13 14:31:18] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:20] Scheduler: Running trials [20]...\n", "[INFO 07-13 14:31:21] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:22] Scheduler: Running trials [21]...\n", "[INFO 07-13 14:31:23] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:23] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:31:23] Scheduler: Retrieved COMPLETED trials: 19 - 21.\n", "[INFO 07-13 14:31:23] Scheduler: Fetching data for trials: 19 - 21.\n", "[ERROR 2023-07-13 14:31:23,589 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-13 14:31:23,611 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:23,638 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.313831360294258}}\n", "[INFO 07-13 14:31:24] Scheduler: Running trials [22]...\n", "[INFO 07-13 14:31:25] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:27] Scheduler: Running trials [23]...\n", "[INFO 07-13 14:31:28] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:31] Scheduler: Running trials [24]...\n", "[INFO 07-13 14:31:32] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:32] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:31:32] Scheduler: Retrieved COMPLETED trials: 22 - 24.\n", "[INFO 07-13 14:31:32] Scheduler: Fetching data for trials: 22 - 24.\n", "[ERROR 2023-07-13 14:31:32,294 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-13 14:31:32,317 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:32,344 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': 1.0901740170548075}}\n", "[INFO 07-13 14:31:33] Scheduler: Running trials [25]...\n", "[INFO 07-13 14:31:34] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:35] Scheduler: Running trials [26]...\n", "[INFO 07-13 14:31:36] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:37] Scheduler: Running trials [27]...\n", "[INFO 07-13 14:31:38] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:38] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:31:38] Scheduler: Retrieved COMPLETED trials: 25 - 27.\n", "[INFO 07-13 14:31:38] Scheduler: Fetching data for trials: 25 - 27.\n", "[ERROR 2023-07-13 14:31:38,952 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-13 14:31:39,000 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:39,060 MainProcess] boa: Trials so far: 28\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {26: {'Cosine8': 0.9560600283858646}}\n", "[INFO 07-13 14:31:40] Scheduler: Running trials [28]...\n", "[INFO 07-13 14:31:41] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:42] Scheduler: Running trials [29]...\n", "[INFO 07-13 14:31:43] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:45] Scheduler: Running trials [30]...\n", "[INFO 07-13 14:31:46] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:46] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:31:46] Scheduler: Retrieved COMPLETED trials: 28 - 30.\n", "[INFO 07-13 14:31:46] Scheduler: Fetching data for trials: 28 - 30.\n", "[ERROR 2023-07-13 14:31:46,257 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-13 14:31:46,291 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:46,323 MainProcess] boa: Trials so far: 31\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {30: {'Cosine8': 0.6371869524764805}}\n", "[INFO 07-13 14:31:47] Scheduler: Running trials [31]...\n", "[INFO 07-13 14:31:48] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:49] Scheduler: Running trials [32]...\n", "[INFO 07-13 14:31:50] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:52] Scheduler: Running trials [33]...\n", "[INFO 07-13 14:31:53] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:53] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:31:53] Scheduler: Retrieved COMPLETED trials: 31 - 33.\n", "[INFO 07-13 14:31:53] Scheduler: Fetching data for trials: 31 - 33.\n", "[ERROR 2023-07-13 14:31:53,606 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-13 14:31:53,637 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:53,669 MainProcess] boa: Trials so far: 34\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {32: {'Cosine8': 0.3850873771835154}}\n", "[INFO 07-13 14:31:54] Scheduler: Running trials [34]...\n", "[INFO 07-13 14:31:55] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:56] Scheduler: Running trials [35]...\n", "[INFO 07-13 14:31:57] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:57] Scheduler: Running trials [36]...\n", "[INFO 07-13 14:31:58] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:31:58] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:31:58] Scheduler: Retrieved COMPLETED trials: 34 - 36.\n", "[INFO 07-13 14:31:58] Scheduler: Fetching data for trials: 34 - 36.\n", "[ERROR 2023-07-13 14:31:58,966 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-13 14:31:58,999 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:59,032 MainProcess] boa: Trials so far: 37\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {32: {'Cosine8': 0.3850873771835154}}\n", "[INFO 07-13 14:32:00] Scheduler: Running trials [37]...\n", "[INFO 07-13 14:32:01] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:01] Scheduler: Running trials [38]...\n", "[INFO 07-13 14:32:02] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:04] Scheduler: Running trials [39]...\n", "[INFO 07-13 14:32:05] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:05] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:32:05] Scheduler: Retrieved COMPLETED trials: 37 - 39.\n", "[INFO 07-13 14:32:05] Scheduler: Fetching data for trials: 37 - 39.\n", "[ERROR 2023-07-13 14:32:05,244 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-13 14:32:05,285 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:32:05,327 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.1477110535728049}}\n", "[INFO 07-13 14:32:06] Scheduler: Running trials [40]...\n", "[INFO 07-13 14:32:07] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:07] Scheduler: Running trials [41]...\n", "[INFO 07-13 14:32:08] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:09] Scheduler: Running trials [42]...\n", "[INFO 07-13 14:32:10] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:10] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:32:10] Scheduler: Retrieved COMPLETED trials: 40 - 42.\n", "[INFO 07-13 14:32:10] Scheduler: Fetching data for trials: 40 - 42.\n", "[ERROR 2023-07-13 14:32:10,603 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-13 14:32:10,648 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:32:10,692 MainProcess] boa: Trials so far: 43\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {40: {'Cosine8': -0.026683676360072683}}\n", "[INFO 07-13 14:32:11] Scheduler: Running trials [43]...\n", "[INFO 07-13 14:32:12] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:12] Scheduler: Running trials [44]...\n", "[INFO 07-13 14:32:14] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:14] Scheduler: Running trials [45]...\n", "[INFO 07-13 14:32:15] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:15] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:32:15] Scheduler: Retrieved COMPLETED trials: 43 - 45.\n", "[INFO 07-13 14:32:15] Scheduler: Fetching data for trials: 43 - 45.\n", "[ERROR 2023-07-13 14:32:15,217 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-13 14:32:15,257 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:32:15,292 MainProcess] boa: Trials so far: 46\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {40: {'Cosine8': -0.026683676360072683}}\n", "[INFO 07-13 14:32:16] Scheduler: Running trials [46]...\n", "[INFO 07-13 14:32:17] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:17] Scheduler: Running trials [47]...\n", "[INFO 07-13 14:32:18] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:19] Scheduler: Running trials [48]...\n", "[INFO 07-13 14:32:20] ax.modelbridge.torch: The observations are identical to the last set of observations used to fit the model. Skipping model fitting.\n", "[INFO 07-13 14:32:20] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.\n", "[INFO 07-13 14:32:20] Scheduler: Retrieved COMPLETED trials: 46 - 48.\n", "[INFO 07-13 14:32:20] Scheduler: Fetching data for trials: 46 - 48.\n", "[ERROR 2023-07-13 14:32:20,768 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-13 14:32:20,812 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:32:20,853 MainProcess] boa: Trials so far: 49\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {47: {'Cosine8': -0.04998773022620064}}\n", "[INFO 07-13 14:32:23] Scheduler: Running trials [49]...\n", "[INFO 07-13 14:32:24] Scheduler: Retrieved COMPLETED trials: [49].\n", "[INFO 07-13 14:32:24] Scheduler: Fetching data for trials: [49].\n", "[ERROR 2023-07-13 14:32:24,070 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-13 14:32:24,121 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:32:24,158 MainProcess] boa: Trials so far: 50\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {47: {'Cosine8': -0.04998773022620064}}\n", "[ERROR 2023-07-13 14:32:24,159 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-13 14:32:24,201 MainProcess] boa: Saved JSON-serialized state of optimization to `/Users/madelinescyphers/Documents/projs_.nosync/boa/docs/examples/boa_runs_20230713T143053/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:32:24,238 MainProcess] boa: Trials so far: 50\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {47: {'Cosine8': -0.04998773022620064}}\n", "[INFO 2023-07-13 14:32:24,261 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_20230713T143053\n", "Start Time: 20230713T143053\n", "Version: 0.8.7.dev4+gae30cf2.d20230713\n", "End Time: 20230713T143224\n", "Total Run Time: 90.65117406845093\n", "\n", " trial_index arm_name trial_status generation_method Cosine8 x0 \\\n", "0 0 0_0 COMPLETED Sobol 2.239105 0.005910 \n", "1 1 1_0 COMPLETED Sobol 4.136699 0.341347 \n", "2 2 2_0 COMPLETED Sobol 1.838099 0.302048 \n", "3 3 3_0 COMPLETED Sobol 2.408117 0.378163 \n", "4 4 4_0 COMPLETED Sobol 2.030690 0.283629 \n", "5 5 5_0 COMPLETED Sobol 2.714052 0.096529 \n", "6 6 6_0 COMPLETED Sobol 3.941725 0.487296 \n", "7 7 7_0 COMPLETED Sobol 3.478950 0.582199 \n", "8 8 8_0 COMPLETED Sobol 3.067485 0.395262 \n", "9 9 9_0 COMPLETED Sobol 3.494017 0.182291 \n", "10 10 10_0 COMPLETED Sobol 3.746949 0.896021 \n", "11 11 11_0 COMPLETED Sobol 3.460985 0.252204 \n", "12 12 12_0 COMPLETED Sobol 1.909430 0.322564 \n", "13 13 13_0 COMPLETED Sobol 3.083720 0.006783 \n", "14 14 14_0 COMPLETED Sobol 1.728998 0.594221 \n", "15 15 15_0 COMPLETED Sobol 2.716962 0.497243 \n", "16 16 16_0 COMPLETED GPEI 1.576633 0.237948 \n", "17 17 17_0 COMPLETED GPEI 1.779049 0.299262 \n", "18 18 18_0 COMPLETED GPEI 1.726575 0.243311 \n", "19 19 19_0 COMPLETED GPEI 1.313831 0.097879 \n", "20 20 20_0 COMPLETED GPEI 1.571842 0.356001 \n", "21 21 21_0 COMPLETED GPEI 2.031018 0.194259 \n", "22 22 22_0 COMPLETED GPEI 1.090174 0.109818 \n", "23 23 23_0 COMPLETED GPEI 1.511682 0.051335 \n", "24 24 24_0 COMPLETED GPEI 1.509907 0.024264 \n", "25 25 25_0 COMPLETED GPEI 1.218323 0.179122 \n", "26 26 26_0 COMPLETED GPEI 0.956060 0.073864 \n", "27 27 27_0 COMPLETED GPEI 1.189037 0.239096 \n", "28 28 28_0 COMPLETED GPEI 1.161395 0.136238 \n", "29 29 29_0 COMPLETED GPEI 0.901676 0.141798 \n", "30 30 30_0 COMPLETED GPEI 0.637187 0.124632 \n", "31 31 31_0 COMPLETED GPEI 0.699642 0.135534 \n", "32 32 32_0 COMPLETED GPEI 0.385087 0.078258 \n", "33 33 33_0 COMPLETED GPEI 0.792845 0.284455 \n", "34 34 34_0 COMPLETED GPEI 0.447897 0.134221 \n", "35 35 35_0 COMPLETED GPEI 0.678093 0.096092 \n", "36 36 36_0 COMPLETED GPEI 0.519007 0.000000 \n", "37 37 37_0 COMPLETED GPEI 0.147711 0.061834 \n", "38 38 38_0 COMPLETED GPEI 0.577436 0.155013 \n", "39 39 39_0 COMPLETED GPEI 0.167808 0.040299 \n", "40 40 40_0 COMPLETED GPEI -0.026684 0.000000 \n", "41 41 41_0 COMPLETED GPEI 0.138651 0.000000 \n", "42 42 42_0 COMPLETED GPEI 0.119586 0.000000 \n", "43 43 43_0 COMPLETED GPEI 0.068217 0.000000 \n", "44 44 44_0 COMPLETED GPEI 0.877557 0.002077 \n", "45 45 45_0 COMPLETED GPEI 1.319131 0.192617 \n", "46 46 46_0 COMPLETED GPEI 0.046132 0.000000 \n", "47 47 47_0 COMPLETED GPEI -0.049988 0.000000 \n", "48 48 48_0 COMPLETED GPEI 0.017012 0.000000 \n", "49 49 49_0 COMPLETED GPEI -0.014501 0.000000 \n", "\n", " x1 x2 x3 x4 x5 x6 x7 \n", "0 0.141367 0.425610 0.810076 0.635368 0.737481 0.202842 0.678401 \n", "1 0.802491 0.530528 0.982942 0.558278 0.774273 0.698905 0.884335 \n", "2 0.279949 0.768200 0.617394 0.314809 0.049353 0.800600 0.165349 \n", "3 0.272300 0.601005 0.585589 0.075222 0.125974 0.767954 0.901783 \n", "4 0.755290 0.824802 0.287725 0.288463 0.035348 0.849888 0.135928 \n", "5 0.478756 0.827078 0.874856 0.580245 0.656032 0.030549 0.542257 \n", "6 0.817129 0.716379 0.836942 0.999895 0.541045 0.672588 0.288226 \n", "7 0.793198 0.758041 0.570732 0.532217 0.236029 0.958385 0.249541 \n", "8 0.826062 0.535096 0.934967 0.645789 0.598909 0.461659 0.370842 \n", "9 0.651113 0.095934 0.183234 0.885109 0.892330 0.478828 0.958136 \n", "10 0.811340 0.677272 0.186724 0.665177 0.693099 0.585175 0.535108 \n", "11 0.733171 0.100481 0.721839 0.489904 0.966838 0.542897 0.879006 \n", "12 0.660139 0.394390 0.604160 0.333827 0.762729 0.174212 0.219013 \n", "13 0.942449 0.745871 0.035081 0.765784 0.865521 0.793785 0.291791 \n", "14 0.255711 0.124992 0.630445 0.026356 0.738504 0.325613 0.206705 \n", "15 0.624900 0.224264 0.841092 0.816033 0.106921 0.200558 0.707149 \n", "16 0.436693 0.788854 0.432752 0.223048 0.000000 0.791934 0.190430 \n", "17 0.142714 0.705431 0.656360 0.233444 0.058971 0.745862 0.370448 \n", "18 0.410822 0.868419 0.523951 0.380031 0.000000 0.850181 0.000000 \n", "19 0.307514 0.849987 0.395135 0.201189 0.000000 0.744476 0.086379 \n", "20 0.279456 0.268597 0.658234 0.136730 0.615719 0.230335 0.160683 \n", "21 0.320616 0.890703 0.422440 0.106872 0.000000 0.927234 0.191639 \n", "22 0.334398 0.738638 0.416773 0.214001 0.000000 0.615096 0.036945 \n", "23 0.300031 0.909676 0.326049 0.350593 0.000000 0.692053 0.192175 \n", "24 0.465266 0.845982 0.565585 0.156025 0.000000 0.700807 0.000000 \n", "25 0.227855 0.607312 0.337567 0.139496 0.111076 0.550089 0.057904 \n", "26 0.316711 0.580849 0.324352 0.266562 0.000000 0.671654 0.000000 \n", "27 0.310938 0.835434 0.357945 0.179805 0.000000 0.553573 0.000000 \n", "28 0.398810 0.603699 0.190971 0.235709 0.000000 0.638339 0.000000 \n", "29 0.168932 0.520647 0.361278 0.320917 0.000000 0.622821 0.000000 \n", "30 0.432791 0.350707 0.369762 0.234442 0.000000 0.587786 0.000000 \n", "31 0.368736 0.173706 0.457136 0.260419 0.000000 0.555950 0.000000 \n", "32 0.456169 0.246560 0.403644 0.345924 0.000000 0.486633 0.000000 \n", "33 0.408784 0.234788 0.442270 0.188929 0.000000 0.577959 0.000000 \n", "34 0.522861 0.270904 0.377555 0.359571 0.000000 0.393155 0.000000 \n", "35 0.522313 0.246609 0.366340 0.445072 0.000000 0.504924 0.000000 \n", "36 0.599985 0.237315 0.415255 0.301226 0.000000 0.393387 0.000000 \n", "37 0.423821 0.317733 0.418750 0.327921 0.000000 0.429865 0.000000 \n", "38 0.493097 0.315974 0.462648 0.319039 0.000000 0.453536 0.000000 \n", "39 0.416899 0.227089 0.326812 0.318066 0.000000 0.424669 0.000000 \n", "40 0.354855 0.323035 0.382071 0.342152 0.000000 0.359387 0.000000 \n", "41 0.345690 0.310210 0.388130 0.343438 0.000000 0.343695 0.118464 \n", "42 0.296299 0.296043 0.411424 0.398979 0.000000 0.287613 0.000000 \n", "43 0.349576 0.315802 0.394896 0.258612 0.000000 0.339006 0.000000 \n", "44 0.040437 0.434454 0.784951 0.170387 0.212122 0.173831 0.352266 \n", "45 0.136338 0.343907 0.902024 0.049123 0.227745 0.107525 0.229977 \n", "46 0.357688 0.330836 0.372033 0.354738 0.087566 0.369367 0.000000 \n", "47 0.358949 0.363587 0.342969 0.357309 0.000000 0.376619 0.000000 \n", "48 0.309014 0.326131 0.398185 0.349283 0.000000 0.398056 0.000000 \n", "49 0.382214 0.342858 0.310059 0.356361 0.000000 0.353866 0.000000 \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": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{49: {'params': {'x0': 0.0,\n", " 'x1': 0.3589494371881439,\n", " 'x2': 0.3635867439663141,\n", " 'x3': 0.3429694617951464,\n", " 'x4': 0.35730864639376125,\n", " 'x5': 0.0,\n", " 'x6': 0.376619314508331,\n", " 'x7': 0.0},\n", " 'means': {'Cosine8': -0.04991830073003367},\n", " 'cov_matrix': {'Cosine8': {'Cosine8': 1.4031232633680942e-06}}}}" ] }, "execution_count": 9, "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": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{47: {'params': {'x0': 0.0,\n", " 'x1': 0.3589494371881439,\n", " 'x2': 0.3635867439663141,\n", " 'x3': 0.3429694617951464,\n", " 'x4': 0.35730864639376125,\n", " 'x5': 0.0,\n", " 'x6': 0.376619314508331,\n", " 'x7': 0.0},\n", " 'means': {'Cosine8': -0.04998773022620064},\n", " 'cov_matrix': {'Cosine8': {'Cosine8': 0.0}}}}" ] }, "execution_count": 10, "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": 11, "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.2391050.0059100.1413670.4256100.8100760.6353680.7374810.2028420.678401
111_0COMPLETEDSobol4.1366990.3413470.8024910.5305280.9829420.5582780.7742730.6989050.884335
222_0COMPLETEDSobol1.8380990.3020480.2799490.7682000.6173940.3148090.0493530.8006000.165349
333_0COMPLETEDSobol2.4081170.3781630.2723000.6010050.5855890.0752220.1259740.7679540.901783
444_0COMPLETEDSobol2.0306900.2836290.7552900.8248020.2877250.2884630.0353480.8498880.135928
555_0COMPLETEDSobol2.7140520.0965290.4787560.8270780.8748560.5802450.6560320.0305490.542257
666_0COMPLETEDSobol3.9417250.4872960.8171290.7163790.8369420.9998950.5410450.6725880.288226
777_0COMPLETEDSobol3.4789500.5821990.7931980.7580410.5707320.5322170.2360290.9583850.249541
888_0COMPLETEDSobol3.0674850.3952620.8260620.5350960.9349670.6457890.5989090.4616590.370842
999_0COMPLETEDSobol3.4940170.1822910.6511130.0959340.1832340.8851090.8923300.4788280.958136
101010_0COMPLETEDSobol3.7469490.8960210.8113400.6772720.1867240.6651770.6930990.5851750.535108
111111_0COMPLETEDSobol3.4609850.2522040.7331710.1004810.7218390.4899040.9668380.5428970.879006
121212_0COMPLETEDSobol1.9094300.3225640.6601390.3943900.6041600.3338270.7627290.1742120.219013
131313_0COMPLETEDSobol3.0837200.0067830.9424490.7458710.0350810.7657840.8655210.7937850.291791
141414_0COMPLETEDSobol1.7289980.5942210.2557110.1249920.6304450.0263560.7385040.3256130.206705
151515_0COMPLETEDSobol2.7169620.4972430.6249000.2242640.8410920.8160330.1069210.2005580.707149
161616_0COMPLETEDGPEI1.5766330.2379480.4366930.7888540.4327520.2230480.0000000.7919340.190430
171717_0COMPLETEDGPEI1.7790490.2992620.1427140.7054310.6563600.2334440.0589710.7458620.370448
181818_0COMPLETEDGPEI1.7265750.2433110.4108220.8684190.5239510.3800310.0000000.8501810.000000
191919_0COMPLETEDGPEI1.3138310.0978790.3075140.8499870.3951350.2011890.0000000.7444760.086379
202020_0COMPLETEDGPEI1.5718420.3560010.2794560.2685970.6582340.1367300.6157190.2303350.160683
212121_0COMPLETEDGPEI2.0310180.1942590.3206160.8907030.4224400.1068720.0000000.9272340.191639
222222_0COMPLETEDGPEI1.0901740.1098180.3343980.7386380.4167730.2140010.0000000.6150960.036945
232323_0COMPLETEDGPEI1.5116820.0513350.3000310.9096760.3260490.3505930.0000000.6920530.192175
242424_0COMPLETEDGPEI1.5099070.0242640.4652660.8459820.5655850.1560250.0000000.7008070.000000
252525_0COMPLETEDGPEI1.2183230.1791220.2278550.6073120.3375670.1394960.1110760.5500890.057904
262626_0COMPLETEDGPEI0.9560600.0738640.3167110.5808490.3243520.2665620.0000000.6716540.000000
272727_0COMPLETEDGPEI1.1890370.2390960.3109380.8354340.3579450.1798050.0000000.5535730.000000
282828_0COMPLETEDGPEI1.1613950.1362380.3988100.6036990.1909710.2357090.0000000.6383390.000000
292929_0COMPLETEDGPEI0.9016760.1417980.1689320.5206470.3612780.3209170.0000000.6228210.000000
303030_0COMPLETEDGPEI0.6371870.1246320.4327910.3507070.3697620.2344420.0000000.5877860.000000
313131_0COMPLETEDGPEI0.6996420.1355340.3687360.1737060.4571360.2604190.0000000.5559500.000000
323232_0COMPLETEDGPEI0.3850870.0782580.4561690.2465600.4036440.3459240.0000000.4866330.000000
333333_0COMPLETEDGPEI0.7928450.2844550.4087840.2347880.4422700.1889290.0000000.5779590.000000
343434_0COMPLETEDGPEI0.4478970.1342210.5228610.2709040.3775550.3595710.0000000.3931550.000000
353535_0COMPLETEDGPEI0.6780930.0960920.5223130.2466090.3663400.4450720.0000000.5049240.000000
363636_0COMPLETEDGPEI0.5190070.0000000.5999850.2373150.4152550.3012260.0000000.3933870.000000
373737_0COMPLETEDGPEI0.1477110.0618340.4238210.3177330.4187500.3279210.0000000.4298650.000000
383838_0COMPLETEDGPEI0.5774360.1550130.4930970.3159740.4626480.3190390.0000000.4535360.000000
393939_0COMPLETEDGPEI0.1678080.0402990.4168990.2270890.3268120.3180660.0000000.4246690.000000
404040_0COMPLETEDGPEI-0.0266840.0000000.3548550.3230350.3820710.3421520.0000000.3593870.000000
414141_0COMPLETEDGPEI0.1386510.0000000.3456900.3102100.3881300.3434380.0000000.3436950.118464
424242_0COMPLETEDGPEI0.1195860.0000000.2962990.2960430.4114240.3989790.0000000.2876130.000000
434343_0COMPLETEDGPEI0.0682170.0000000.3495760.3158020.3948960.2586120.0000000.3390060.000000
444444_0COMPLETEDGPEI0.8775570.0020770.0404370.4344540.7849510.1703870.2121220.1738310.352266
454545_0COMPLETEDGPEI1.3191310.1926170.1363380.3439070.9020240.0491230.2277450.1075250.229977
464646_0COMPLETEDGPEI0.0461320.0000000.3576880.3308360.3720330.3547380.0875660.3693670.000000
474747_0COMPLETEDGPEI-0.0499880.0000000.3589490.3635870.3429690.3573090.0000000.3766190.000000
484848_0COMPLETEDGPEI0.0170120.0000000.3090140.3261310.3981850.3492830.0000000.3980560.000000
494949_0COMPLETEDGPEI-0.0145010.0000000.3822140.3428580.3100590.3563610.0000000.3538660.000000
\n", "
" ], "text/plain": [ " trial_index arm_name trial_status generation_method Cosine8 x0 \\\n", "0 0 0_0 COMPLETED Sobol 2.239105 0.005910 \n", "1 1 1_0 COMPLETED Sobol 4.136699 0.341347 \n", "2 2 2_0 COMPLETED Sobol 1.838099 0.302048 \n", "3 3 3_0 COMPLETED Sobol 2.408117 0.378163 \n", "4 4 4_0 COMPLETED Sobol 2.030690 0.283629 \n", "5 5 5_0 COMPLETED Sobol 2.714052 0.096529 \n", "6 6 6_0 COMPLETED Sobol 3.941725 0.487296 \n", "7 7 7_0 COMPLETED Sobol 3.478950 0.582199 \n", "8 8 8_0 COMPLETED Sobol 3.067485 0.395262 \n", "9 9 9_0 COMPLETED Sobol 3.494017 0.182291 \n", "10 10 10_0 COMPLETED Sobol 3.746949 0.896021 \n", "11 11 11_0 COMPLETED Sobol 3.460985 0.252204 \n", "12 12 12_0 COMPLETED Sobol 1.909430 0.322564 \n", "13 13 13_0 COMPLETED Sobol 3.083720 0.006783 \n", "14 14 14_0 COMPLETED Sobol 1.728998 0.594221 \n", "15 15 15_0 COMPLETED Sobol 2.716962 0.497243 \n", "16 16 16_0 COMPLETED GPEI 1.576633 0.237948 \n", "17 17 17_0 COMPLETED GPEI 1.779049 0.299262 \n", "18 18 18_0 COMPLETED GPEI 1.726575 0.243311 \n", "19 19 19_0 COMPLETED GPEI 1.313831 0.097879 \n", "20 20 20_0 COMPLETED GPEI 1.571842 0.356001 \n", "21 21 21_0 COMPLETED GPEI 2.031018 0.194259 \n", "22 22 22_0 COMPLETED GPEI 1.090174 0.109818 \n", "23 23 23_0 COMPLETED GPEI 1.511682 0.051335 \n", "24 24 24_0 COMPLETED GPEI 1.509907 0.024264 \n", "25 25 25_0 COMPLETED GPEI 1.218323 0.179122 \n", "26 26 26_0 COMPLETED GPEI 0.956060 0.073864 \n", "27 27 27_0 COMPLETED GPEI 1.189037 0.239096 \n", "28 28 28_0 COMPLETED GPEI 1.161395 0.136238 \n", "29 29 29_0 COMPLETED GPEI 0.901676 0.141798 \n", "30 30 30_0 COMPLETED GPEI 0.637187 0.124632 \n", "31 31 31_0 COMPLETED GPEI 0.699642 0.135534 \n", "32 32 32_0 COMPLETED GPEI 0.385087 0.078258 \n", "33 33 33_0 COMPLETED GPEI 0.792845 0.284455 \n", "34 34 34_0 COMPLETED GPEI 0.447897 0.134221 \n", "35 35 35_0 COMPLETED GPEI 0.678093 0.096092 \n", "36 36 36_0 COMPLETED GPEI 0.519007 0.000000 \n", "37 37 37_0 COMPLETED GPEI 0.147711 0.061834 \n", "38 38 38_0 COMPLETED GPEI 0.577436 0.155013 \n", "39 39 39_0 COMPLETED GPEI 0.167808 0.040299 \n", "40 40 40_0 COMPLETED GPEI -0.026684 0.000000 \n", "41 41 41_0 COMPLETED GPEI 0.138651 0.000000 \n", "42 42 42_0 COMPLETED GPEI 0.119586 0.000000 \n", "43 43 43_0 COMPLETED GPEI 0.068217 0.000000 \n", "44 44 44_0 COMPLETED GPEI 0.877557 0.002077 \n", "45 45 45_0 COMPLETED GPEI 1.319131 0.192617 \n", "46 46 46_0 COMPLETED GPEI 0.046132 0.000000 \n", "47 47 47_0 COMPLETED GPEI -0.049988 0.000000 \n", "48 48 48_0 COMPLETED GPEI 0.017012 0.000000 \n", "49 49 49_0 COMPLETED GPEI -0.014501 0.000000 \n", "\n", " x1 x2 x3 x4 x5 x6 x7 \n", "0 0.141367 0.425610 0.810076 0.635368 0.737481 0.202842 0.678401 \n", "1 0.802491 0.530528 0.982942 0.558278 0.774273 0.698905 0.884335 \n", "2 0.279949 0.768200 0.617394 0.314809 0.049353 0.800600 0.165349 \n", "3 0.272300 0.601005 0.585589 0.075222 0.125974 0.767954 0.901783 \n", "4 0.755290 0.824802 0.287725 0.288463 0.035348 0.849888 0.135928 \n", "5 0.478756 0.827078 0.874856 0.580245 0.656032 0.030549 0.542257 \n", "6 0.817129 0.716379 0.836942 0.999895 0.541045 0.672588 0.288226 \n", "7 0.793198 0.758041 0.570732 0.532217 0.236029 0.958385 0.249541 \n", "8 0.826062 0.535096 0.934967 0.645789 0.598909 0.461659 0.370842 \n", "9 0.651113 0.095934 0.183234 0.885109 0.892330 0.478828 0.958136 \n", "10 0.811340 0.677272 0.186724 0.665177 0.693099 0.585175 0.535108 \n", "11 0.733171 0.100481 0.721839 0.489904 0.966838 0.542897 0.879006 \n", "12 0.660139 0.394390 0.604160 0.333827 0.762729 0.174212 0.219013 \n", "13 0.942449 0.745871 0.035081 0.765784 0.865521 0.793785 0.291791 \n", "14 0.255711 0.124992 0.630445 0.026356 0.738504 0.325613 0.206705 \n", "15 0.624900 0.224264 0.841092 0.816033 0.106921 0.200558 0.707149 \n", "16 0.436693 0.788854 0.432752 0.223048 0.000000 0.791934 0.190430 \n", "17 0.142714 0.705431 0.656360 0.233444 0.058971 0.745862 0.370448 \n", "18 0.410822 0.868419 0.523951 0.380031 0.000000 0.850181 0.000000 \n", "19 0.307514 0.849987 0.395135 0.201189 0.000000 0.744476 0.086379 \n", "20 0.279456 0.268597 0.658234 0.136730 0.615719 0.230335 0.160683 \n", "21 0.320616 0.890703 0.422440 0.106872 0.000000 0.927234 0.191639 \n", "22 0.334398 0.738638 0.416773 0.214001 0.000000 0.615096 0.036945 \n", "23 0.300031 0.909676 0.326049 0.350593 0.000000 0.692053 0.192175 \n", "24 0.465266 0.845982 0.565585 0.156025 0.000000 0.700807 0.000000 \n", "25 0.227855 0.607312 0.337567 0.139496 0.111076 0.550089 0.057904 \n", "26 0.316711 0.580849 0.324352 0.266562 0.000000 0.671654 0.000000 \n", "27 0.310938 0.835434 0.357945 0.179805 0.000000 0.553573 0.000000 \n", "28 0.398810 0.603699 0.190971 0.235709 0.000000 0.638339 0.000000 \n", "29 0.168932 0.520647 0.361278 0.320917 0.000000 0.622821 0.000000 \n", "30 0.432791 0.350707 0.369762 0.234442 0.000000 0.587786 0.000000 \n", "31 0.368736 0.173706 0.457136 0.260419 0.000000 0.555950 0.000000 \n", "32 0.456169 0.246560 0.403644 0.345924 0.000000 0.486633 0.000000 \n", "33 0.408784 0.234788 0.442270 0.188929 0.000000 0.577959 0.000000 \n", "34 0.522861 0.270904 0.377555 0.359571 0.000000 0.393155 0.000000 \n", "35 0.522313 0.246609 0.366340 0.445072 0.000000 0.504924 0.000000 \n", "36 0.599985 0.237315 0.415255 0.301226 0.000000 0.393387 0.000000 \n", "37 0.423821 0.317733 0.418750 0.327921 0.000000 0.429865 0.000000 \n", "38 0.493097 0.315974 0.462648 0.319039 0.000000 0.453536 0.000000 \n", "39 0.416899 0.227089 0.326812 0.318066 0.000000 0.424669 0.000000 \n", "40 0.354855 0.323035 0.382071 0.342152 0.000000 0.359387 0.000000 \n", "41 0.345690 0.310210 0.388130 0.343438 0.000000 0.343695 0.118464 \n", "42 0.296299 0.296043 0.411424 0.398979 0.000000 0.287613 0.000000 \n", "43 0.349576 0.315802 0.394896 0.258612 0.000000 0.339006 0.000000 \n", "44 0.040437 0.434454 0.784951 0.170387 0.212122 0.173831 0.352266 \n", "45 0.136338 0.343907 0.902024 0.049123 0.227745 0.107525 0.229977 \n", "46 0.357688 0.330836 0.372033 0.354738 0.087566 0.369367 0.000000 \n", "47 0.358949 0.363587 0.342969 0.357309 0.000000 0.376619 0.000000 \n", "48 0.309014 0.326131 0.398185 0.349283 0.000000 0.398056 0.000000 \n", "49 0.382214 0.342858 0.310059 0.356361 0.000000 0.353866 0.000000 " ] }, "execution_count": 11, "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 [conda env:boa-dev]", "language": "python", "name": "conda-env-boa-dev-py" }, "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.12" }, "vscode": { "interpreter": { "hash": "e4753ff389e29e439da2b5f976c0c752a36b29db5d37953ba5fa1bffb26df317" } } }, "nbformat": 4, "nbformat_minor": 4 }