{ "cells": [ { "cell_type": "markdown", "id": "130d0e72-62b8-4d38-8989-28b2e4a4ef48", "metadata": { "tags": [] }, "source": [ "# Running an R Script with BOA\n", "\n", "This notebook demonstrates how to:\n", "\n", "Write a basic Wrapper script in R and have BOA launch your optimization using the BOA CLI interface. See {mod}`instructions for creating a model wrapper <.boa.wrappers>` for more details about creating a wrapper script.\n", "You can also look at {doc}`instructions for configurations files` for more details on creating a configuration file." ] }, { "cell_type": "code", "execution_count": 1, "id": "27dcc4de-d3d0-4865-aa1e-667d2b0ff2b1", "metadata": { "tags": [ "remove-cell" ] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[WARNING 07-13 14:30:45] 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": "89ea7a7f-e6d7-4f98-a936-fa4826af05cb" } }, "output_type": "display_data" } ], "source": [ "# This notebook uses hidden cells to import and display things so\n", "# that it can be ran regullary to make sure the documentation\n", "# is up to date and not broken (as opposed to a markdown file\n", "# that would have an exmaple written once and get out of date\n", "# as the code base changes)\n", "\n", "# These hidden cells are only responsible for rerunning\n", "# the documentation to ensure it is correct.\n", "# the actual relavent part of the documentation\n", "# are the non hidden parts\n", "import pathlib\n", "import re\n", "import shutil\n", "\n", "from IPython.display import Code\n", "\n", "import boa" ] }, { "cell_type": "code", "execution_count": 2, "id": "a1149922-0d89-4146-9236-7ff758f44435", "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "boa_dir = pathlib.Path().resolve().parent.parent\n", "r_dir = boa_dir / \"tests/scripts/other_langs/r_package_streamlined\"\n", "config_path = r_dir / \"config.yaml\"\n", "wrapper_script_path = r_dir / \"run_model.R\"\n", "hartman6_path = r_dir.parent / \"r_utils/hartman6.R\"\n", "\n", "config = boa.load_jsonlike(config_path)\n", "ex_name = config[\"optimization_options\"][\"experiment\"][\"name\"]\n", "total_trials = config[\"optimization_options\"][\"trials\"]" ] }, { "cell_type": "code", "execution_count": 3, "id": "66812670-9c0b-4ddb-9dfd-5ff0cbb45a3f", "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "# Remove old runs to have a clean slate for this example\n", "old_runs = pathlib.Path().resolve().glob(f\"{ex_name}*\")\n", "for path in old_runs:\n", " shutil.rmtree(path)\n", "old_runs = r_dir.glob(f\"{ex_name}*\")\n", "for path in old_runs:\n", " shutil.rmtree(path)" ] }, { "cell_type": "markdown", "id": "74999810-5017-46f2-9ea6-d19e6ac55164", "metadata": {}, "source": [ "## Configuration File Overview\n", "\n", "config.yaml" ] }, { "cell_type": "code", "execution_count": 4, "id": "6050297d-3485-48bc-bcba-49b8e1f0eb0d", "metadata": { "tags": [ "remove-input" ] }, "outputs": [ { "data": { "text/html": [ "
optimization_options:\n",
       "    objective_options:\n",
       "        objectives:\n",
       "            - name: metric\n",
       "    experiment:\n",
       "        name: "r_streamlined_run"\n",
       "    trials: 15\n",
       "\n",
       "parameters:\n",
       "    x0:\n",
       "        'bounds': [ 0, 1 ]\n",
       "        'type': 'range'\n",
       "        'value_type': 'float'\n",
       "    x1:\n",
       "        'bounds': [ 0, 1]\n",
       "        'type': 'range'\n",
       "        'value_type': 'float'\n",
       "    x2:\n",
       "        'bounds': [ 0, 1 ]\n",
       "        'type': 'range'\n",
       "        'value_type': 'float'\n",
       "    x3:\n",
       "        'bounds': [ 0, 1]\n",
       "        'type': 'range'\n",
       "        'value_type': 'float'\n",
       "    x4:\n",
       "        'bounds': [ 0, 1 ]\n",
       "        'type': 'range'\n",
       "        'value_type': 'float'\n",
       "    x5:\n",
       "        'bounds': [ 0, 1]\n",
       "        'type': 'range'\n",
       "        'value_type': 'float'\n",
       "\n",
       "script_options:\n",
       "    # notice here that this is a shell command\n",
       "    # this is what BOA will do to launch your script\n",
       "    # it will also pass as a command line argument the current trial directory\n",
       "    # that is being parameterized\n",
       "\n",
       "    # This can either be a relative path or absolute path\n",
       "    # (by default when BOA launches from a config file\n",
       "    # it uses the config file directory as your working directory)\n",
       "    # here config.yaml and run_model.R are in the same directory\n",
       "    run_model: Rscript run_model.R\n",
       "\n",
       "\n",
       "# options only needed by the model and not BOA\n",
       "# You can put anything here that your model might need\n",
       "# We don't need anything extra so we leave it commented out\n",
       "# model_options:\n",
       "    # the_question: 42\n",
       "
\n" ], "text/latex": [ "\\begin{Verbatim}[commandchars=\\\\\\{\\}]\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}{metric}\n", "\\PY{+w}{ }\\PY{n+nt}{experiment}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{name}\\PY{p}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZdq{}}\\PY{l+s}{r\\PYZus{}streamlined\\PYZus{}run}\\PY{l+s}{\\PYZdq{}}\n", "\\PY{+w}{ }\\PY{n+nt}{trials}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{15}\n", "\n", "\\PY{n+nt}{parameters}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{n+nt}{x0}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{bounds}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{+w}{ }\\PY{n+nv}{0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1}\\PY{+w}{ }\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{range}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{value\\PYZus{}type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{float}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{n+nt}{x1}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{bounds}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{+w}{ }\\PY{n+nv}{0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{range}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{value\\PYZus{}type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{float}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{n+nt}{x2}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{bounds}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{+w}{ }\\PY{n+nv}{0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1}\\PY{+w}{ }\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{range}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{value\\PYZus{}type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{float}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{n+nt}{x3}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{bounds}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{+w}{ }\\PY{n+nv}{0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{range}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{value\\PYZus{}type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{float}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{n+nt}{x4}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{bounds}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{+w}{ }\\PY{n+nv}{0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1}\\PY{+w}{ }\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{range}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{value\\PYZus{}type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{float}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{n+nt}{x5}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{bounds}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{p+pIndicator}{[}\\PY{+w}{ }\\PY{n+nv}{0}\\PY{p+pIndicator}{,}\\PY{+w}{ }\\PY{n+nv}{1}\\PY{p+pIndicator}{]}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{range}\\PY{l+s}{\\PYZsq{}}\n", "\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{value\\PYZus{}type}\\PY{l+s}{\\PYZsq{}}\\PY{p+pIndicator}{:}\\PY{+w}{ }\\PY{l+s}{\\PYZsq{}}\\PY{l+s}{float}\\PY{l+s}{\\PYZsq{}}\n", "\n", "\\PY{n+nt}{script\\PYZus{}options}\\PY{p}{:}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} notice here that this is a shell command}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} this is what BOA will do to launch your script}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} it will also pass as a command line argument the current trial directory}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} that is being parameterized}\n", "\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} This can either be a relative path or absolute path}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} (by default when BOA launches from a config file}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} it uses the config file directory as your working directory)}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} here config.yaml and run\\PYZus{}model.R are in the same directory}\n", "\\PY{+w}{ }\\PY{n+nt}{run\\PYZus{}model}\\PY{p}{:}\\PY{+w}{ }\\PY{l+lScalar+lScalarPlain}{Rscript}\\PY{l+lScalar+lScalarPlain}{ }\\PY{l+lScalar+lScalarPlain}{run\\PYZus{}model.R}\n", "\n", "\n", "\\PY{c+c1}{\\PYZsh{} options only needed by the model and not BOA}\n", "\\PY{c+c1}{\\PYZsh{} You can put anything here that your model might need}\n", "\\PY{c+c1}{\\PYZsh{} We don\\PYZsq{}t need anything extra so we leave it commented out}\n", "\\PY{c+c1}{\\PYZsh{} model\\PYZus{}options:}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} the\\PYZus{}question: 42}\n", "\\end{Verbatim}\n" ], "text/plain": [ "optimization_options:\n", " objective_options:\n", " objectives:\n", " - name: metric\n", " experiment:\n", " name: \"r_streamlined_run\"\n", " trials: 15\n", "\n", "parameters:\n", " x0:\n", " 'bounds': [ 0, 1 ]\n", " 'type': 'range'\n", " 'value_type': 'float'\n", " x1:\n", " 'bounds': [ 0, 1]\n", " 'type': 'range'\n", " 'value_type': 'float'\n", " x2:\n", " 'bounds': [ 0, 1 ]\n", " 'type': 'range'\n", " 'value_type': 'float'\n", " x3:\n", " 'bounds': [ 0, 1]\n", " 'type': 'range'\n", " 'value_type': 'float'\n", " x4:\n", " 'bounds': [ 0, 1 ]\n", " 'type': 'range'\n", " 'value_type': 'float'\n", " x5:\n", " 'bounds': [ 0, 1]\n", " 'type': 'range'\n", " 'value_type': 'float'\n", "\n", "script_options:\n", " # notice here that this is a shell command\n", " # this is what BOA will do to launch your script\n", " # it will also pass as a command line argument the current trial directory\n", " # that is being parameterized\n", "\n", " # This can either be a relative path or absolute path\n", " # (by default when BOA launches from a config file\n", " # it uses the config file directory as your working directory)\n", " # here config.yaml and run_model.R are in the same directory\n", " run_model: Rscript run_model.R\n", "\n", "\n", "# options only needed by the model and not BOA\n", "# You can put anything here that your model might need\n", "# We don't need anything extra so we leave it commented out\n", "# model_options:\n", " # the_question: 42" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Code(config_path)" ] }, { "cell_type": "markdown", "id": "5a231fe4-5ac4-42c2-a7a1-1531335c7fb2", "metadata": { "tags": [] }, "source": [ "## Wrapper Run Script\n", "\n", "run_model.R" ] }, { "cell_type": "code", "execution_count": 5, "id": "1332c2f4-8497-4ad5-8416-0baeda8d24ca", "metadata": { "tags": [ "remove-input" ] }, "outputs": [ { "data": { "text/html": [ "
# load in any libraries and modules we need\n",
       "library(jsonlite)\n",
       "source("../r_utils/hartman6.R")\n",
       "\n",
       "# This is where we read in from BOA the command line argument.\n",
       "# If in your script, you use any other command line arguments,\n",
       "# generally BOA's trial_dir should be the last command line arugment,\n",
       "# so taking the last one should generally be safe.\n",
       "args <- commandArgs(trailingOnly=TRUE)\n",
       "trial_dir <- args[length(args)]\n",
       "\n",
       "# this this trial_dir folder there are 2 files supplied by BOA,\n",
       "# a parameters.json that has just the parameters, and a trial.json\n",
       "# that includes the parameters and a lot more in case you need it.\n",
       "# Most people will only need the parameters.json\n",
       "param_path <- file.path(trial_dir, "parameters.json")\n",
       "data <- read_json(path=param_path)\n",
       "\n",
       "# The parameter keys config from whatever you  named them in your\n",
       "# config file, which you are free to change.\n",
       "x0 <- data$x0\n",
       "x1 <- data$x1\n",
       "x2 <- data$x2\n",
       "x3 <- data$x3\n",
       "x4 <- data$x4\n",
       "x5 <- data$x5\n",
       "X <- c(x0, x1, x2, x3, x4, x5)\n",
       "\n",
       "# This is where we actually run our "model".\n",
       "# Here we are using a synthetic function called hartman6\n",
       "# But you could substitute it for your own model in\n",
       "# a number of ways.\n",
       "res <- hartman6(X)\n",
       "\n",
       "# In this case, we directly ran the model, so we are getting back a number\n",
       "# or nan, so we know if it succeeded or failed. If you are submitting a job\n",
       "# to an HPC (a super computer) queue, this might work, or you might have to\n",
       "# rely on another method. Other options could be relying on log file output\n",
       "# or information from querying the queue itself,\n",
       "# though those may be better as stand alone `Set Trial Status Scripts`\n",
       "if (!is.na(res)) {\n",
       "\n",
       "    # if it was a success, we don't even need to write out trial status,\n",
       "    # it is assumed a success if we write out data and don't fail\n",
       "    out_data <- list(\n",
       "        metric=res\n",
       "        # trial_status=unbox("COMPLETED")  #  this is optional if it succeeds\n",
       "    )\n",
       "\n",
       "} else {\n",
       "\n",
       "    # If we fail, then we do need to include a trial status, and mark it as failed.\n",
       "    out_data <- list(\n",
       "        trial_status=unbox("FAILED")\n",
       "    )\n",
       "}\n",
       "\n",
       "json_data <- toJSON(out_data, pretty = TRUE)\n",
       "write(json_data, file.path(trial_dir, "output.json"))\n",
       "
\n" ], "text/latex": [ "\\begin{Verbatim}[commandchars=\\\\\\{\\}]\n", "\\PY{c+c1}{\\PYZsh{} load in any libraries and modules we need}\n", "\\PY{n+nf}{library}\\PY{p}{(}\\PY{n}{jsonlite}\\PY{p}{)}\n", "\\PY{n+nf}{source}\\PY{p}{(}\\PY{l+s}{\\PYZdq{}}\\PY{l+s}{../r\\PYZus{}utils/hartman6.R\\PYZdq{}}\\PY{p}{)}\n", "\n", "\\PY{c+c1}{\\PYZsh{} This is where we read in from BOA the command line argument.}\n", "\\PY{c+c1}{\\PYZsh{} If in your script, you use any other command line arguments,}\n", "\\PY{c+c1}{\\PYZsh{} generally BOA\\PYZsq{}s trial\\PYZus{}dir should be the last command line arugment,}\n", "\\PY{c+c1}{\\PYZsh{} so taking the last one should generally be safe.}\n", "\\PY{n}{args}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n+nf}{commandArgs}\\PY{p}{(}\\PY{n}{trailingOnly}\\PY{o}{=}\\PY{k+kc}{TRUE}\\PY{p}{)}\n", "\\PY{n}{trial\\PYZus{}dir}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n}{args}\\PY{p}{[}\\PY{n+nf}{length}\\PY{p}{(}\\PY{n}{args}\\PY{p}{)}\\PY{p}{]}\n", "\n", "\\PY{c+c1}{\\PYZsh{} this this trial\\PYZus{}dir folder there are 2 files supplied by BOA,}\n", "\\PY{c+c1}{\\PYZsh{} a parameters.json that has just the parameters, and a trial.json}\n", "\\PY{c+c1}{\\PYZsh{} that includes the parameters and a lot more in case you need it.}\n", "\\PY{c+c1}{\\PYZsh{} Most people will only need the parameters.json}\n", "\\PY{n}{param\\PYZus{}path}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n+nf}{file.path}\\PY{p}{(}\\PY{n}{trial\\PYZus{}dir}\\PY{p}{,}\\PY{+w}{ }\\PY{l+s}{\\PYZdq{}}\\PY{l+s}{parameters.json\\PYZdq{}}\\PY{p}{)}\n", "\\PY{n}{data}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n+nf}{read\\PYZus{}json}\\PY{p}{(}\\PY{n}{path}\\PY{o}{=}\\PY{n}{param\\PYZus{}path}\\PY{p}{)}\n", "\n", "\\PY{c+c1}{\\PYZsh{} The parameter keys config from whatever you named them in your}\n", "\\PY{c+c1}{\\PYZsh{} config file, which you are free to change.}\n", "\\PY{n}{x0}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n}{data}\\PY{o}{\\PYZdl{}}\\PY{n}{x0}\n", "\\PY{n}{x1}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n}{data}\\PY{o}{\\PYZdl{}}\\PY{n}{x1}\n", "\\PY{n}{x2}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n}{data}\\PY{o}{\\PYZdl{}}\\PY{n}{x2}\n", "\\PY{n}{x3}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n}{data}\\PY{o}{\\PYZdl{}}\\PY{n}{x3}\n", "\\PY{n}{x4}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n}{data}\\PY{o}{\\PYZdl{}}\\PY{n}{x4}\n", "\\PY{n}{x5}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n}{data}\\PY{o}{\\PYZdl{}}\\PY{n}{x5}\n", "\\PY{n}{X}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n+nf}{c}\\PY{p}{(}\\PY{n}{x0}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{x1}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{x2}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{x3}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{x4}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{x5}\\PY{p}{)}\n", "\n", "\\PY{c+c1}{\\PYZsh{} This is where we actually run our \\PYZdq{}model\\PYZdq{}.}\n", "\\PY{c+c1}{\\PYZsh{} Here we are using a synthetic function called hartman6}\n", "\\PY{c+c1}{\\PYZsh{} But you could substitute it for your own model in}\n", "\\PY{c+c1}{\\PYZsh{} a number of ways.}\n", "\\PY{n}{res}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n+nf}{hartman6}\\PY{p}{(}\\PY{n}{X}\\PY{p}{)}\n", "\n", "\\PY{c+c1}{\\PYZsh{} In this case, we directly ran the model, so we are getting back a number}\n", "\\PY{c+c1}{\\PYZsh{} or nan, so we know if it succeeded or failed. If you are submitting a job}\n", "\\PY{c+c1}{\\PYZsh{} to an HPC (a super computer) queue, this might work, or you might have to}\n", "\\PY{c+c1}{\\PYZsh{} rely on another method. Other options could be relying on log file output}\n", "\\PY{c+c1}{\\PYZsh{} or information from querying the queue itself,}\n", "\\PY{c+c1}{\\PYZsh{} though those may be better as stand alone `Set Trial Status Scripts`}\n", "\\PY{n+nf}{if }\\PY{p}{(}\\PY{o}{!}\\PY{n+nf}{is.na}\\PY{p}{(}\\PY{n}{res}\\PY{p}{)}\\PY{p}{)}\\PY{+w}{ }\\PY{p}{\\PYZob{}}\n", "\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} if it was a success, we don\\PYZsq{}t even need to write out trial status,}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} it is assumed a success if we write out data and don\\PYZsq{}t fail}\n", "\\PY{+w}{ }\\PY{n}{out\\PYZus{}data}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n+nf}{list}\\PY{p}{(}\n", "\\PY{+w}{ }\\PY{n}{metric}\\PY{o}{=}\\PY{n}{res}\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} trial\\PYZus{}status=unbox(\\PYZdq{}COMPLETED\\PYZdq{}) \\PYZsh{} this is optional if it succeeds}\n", "\\PY{+w}{ }\\PY{p}{)}\n", "\n", "\\PY{p}{\\PYZcb{}}\\PY{+w}{ }\\PY{n}{else}\\PY{+w}{ }\\PY{p}{\\PYZob{}}\n", "\n", "\\PY{+w}{ }\\PY{c+c1}{\\PYZsh{} If we fail, then we do need to include a trial status, and mark it as failed.}\n", "\\PY{+w}{ }\\PY{n}{out\\PYZus{}data}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n+nf}{list}\\PY{p}{(}\n", "\\PY{+w}{ }\\PY{n}{trial\\PYZus{}status}\\PY{o}{=}\\PY{n+nf}{unbox}\\PY{p}{(}\\PY{l+s}{\\PYZdq{}}\\PY{l+s}{FAILED\\PYZdq{}}\\PY{p}{)}\n", "\\PY{+w}{ }\\PY{p}{)}\n", "\\PY{p}{\\PYZcb{}}\n", "\n", "\\PY{n}{json\\PYZus{}data}\\PY{+w}{ }\\PY{o}{\\PYZlt{}\\PYZhy{}}\\PY{+w}{ }\\PY{n+nf}{toJSON}\\PY{p}{(}\\PY{n}{out\\PYZus{}data}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{pretty}\\PY{+w}{ }\\PY{o}{=}\\PY{+w}{ }\\PY{k+kc}{TRUE}\\PY{p}{)}\n", "\\PY{n+nf}{write}\\PY{p}{(}\\PY{n}{json\\PYZus{}data}\\PY{p}{,}\\PY{+w}{ }\\PY{n+nf}{file.path}\\PY{p}{(}\\PY{n}{trial\\PYZus{}dir}\\PY{p}{,}\\PY{+w}{ }\\PY{l+s}{\\PYZdq{}}\\PY{l+s}{output.json\\PYZdq{}}\\PY{p}{)}\\PY{p}{)}\n", "\\end{Verbatim}\n" ], "text/plain": [ "# load in any libraries and modules we need\n", "library(jsonlite)\n", "source(\"../r_utils/hartman6.R\")\n", "\n", "# This is where we read in from BOA the command line argument.\n", "# If in your script, you use any other command line arguments,\n", "# generally BOA's trial_dir should be the last command line arugment,\n", "# so taking the last one should generally be safe.\n", "args <- commandArgs(trailingOnly=TRUE)\n", "trial_dir <- args[length(args)]\n", "\n", "# this this trial_dir folder there are 2 files supplied by BOA,\n", "# a parameters.json that has just the parameters, and a trial.json\n", "# that includes the parameters and a lot more in case you need it.\n", "# Most people will only need the parameters.json\n", "param_path <- file.path(trial_dir, \"parameters.json\")\n", "data <- read_json(path=param_path)\n", "\n", "# The parameter keys config from whatever you named them in your\n", "# config file, which you are free to change.\n", "x0 <- data$x0\n", "x1 <- data$x1\n", "x2 <- data$x2\n", "x3 <- data$x3\n", "x4 <- data$x4\n", "x5 <- data$x5\n", "X <- c(x0, x1, x2, x3, x4, x5)\n", "\n", "# This is where we actually run our \"model\".\n", "# Here we are using a synthetic function called hartman6\n", "# But you could substitute it for your own model in\n", "# a number of ways.\n", "res <- hartman6(X)\n", "\n", "# In this case, we directly ran the model, so we are getting back a number\n", "# or nan, so we know if it succeeded or failed. If you are submitting a job\n", "# to an HPC (a super computer) queue, this might work, or you might have to\n", "# rely on another method. Other options could be relying on log file output\n", "# or information from querying the queue itself,\n", "# though those may be better as stand alone `Set Trial Status Scripts`\n", "if (!is.na(res)) {\n", "\n", " # if it was a success, we don't even need to write out trial status,\n", " # it is assumed a success if we write out data and don't fail\n", " out_data <- list(\n", " metric=res\n", " # trial_status=unbox(\"COMPLETED\") # this is optional if it succeeds\n", " )\n", "\n", "} else {\n", "\n", " # If we fail, then we do need to include a trial status, and mark it as failed.\n", " out_data <- list(\n", " trial_status=unbox(\"FAILED\")\n", " )\n", "}\n", "\n", "json_data <- toJSON(out_data, pretty = TRUE)\n", "write(json_data, file.path(trial_dir, \"output.json\"))" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Code(wrapper_script_path)" ] }, { "cell_type": "markdown", "id": "da660587-ff82-4a29-bd67-7ec7d0e68482", "metadata": {}, "source": [ "We also use a function called hartman6 which is a 6 dimensional version of the synthetic hartman function as the stand in for our model function. The code is below. You would substitute this for any call your model, be it local call to your own R model, a system call to a fortran model wrapped in your R script, or perhaps a some code that launches a HPC job and collects the results.\n", "\n", "hartman6.R" ] }, { "cell_type": "code", "execution_count": 6, "id": "fe1526e8-1f37-4631-bb82-c5426e59191a", "metadata": { "tags": [ "remove-input" ] }, "outputs": [ { "data": { "text/html": [ "
hartman6 <- function(X) {\n",
       "     out <- tryCatch(\n",
       "     {\n",
       "          alpha <- c(1.0, 1.2, 3.0, 3.2)\n",
       "          A <- c(10, 3, 17, 3.5, 1.7, 8,\n",
       "                 0.05, 10, 17, 0.1, 8, 14,\n",
       "                 3, 3.5, 1.7, 10, 17, 8,\n",
       "                 17, 8, 0.05, 10, 0.1, 14)\n",
       "          A <- matrix(A, 4, 6, byrow=TRUE)\n",
       "          P <- 10^(-4) * c(1312, 1696, 5569, 124, 8283, 5886,\n",
       "                           2329, 4135, 8307, 3736, 1004, 9991,\n",
       "                           2348, 1451, 3522, 2883, 3047, 6650,\n",
       "                           4047, 8828, 8732, 5743, 1091, 381)\n",
       "          P <- matrix(P, 4, 6, byrow=TRUE)\n",
       "\n",
       "          Xmat <- matrix(rep(X,times=4), 4, 6, byrow=TRUE)\n",
       "          inner_sum <- rowSums(A[,1:6]*(Xmat-P[,1:6])^2)\n",
       "          outer_sum <- sum(alpha * exp(-inner_sum))\n",
       "          y <- -outer_sum\n",
       "          return(y)\n",
       "     },\n",
       "       error=function(cond) {\n",
       "            return(NA)\n",
       "        }\n",
       "     )\n",
       "    return(out)\n",
       "}\n",
       "
\n" ], "text/latex": [ "\\begin{Verbatim}[commandchars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nf}{function}\\PY{p}{(}\\PY{n}{cond}\\PY{p}{)}\\PY{+w}{ }\\PY{p}{\\PYZob{}}\n", "\\PY{+w}{ }\\PY{n+nf}{return}\\PY{p}{(}\\PY{k+kc}{NA}\\PY{p}{)}\n", "\\PY{+w}{ }\\PY{p}{\\PYZcb{}}\n", "\\PY{+w}{ }\\PY{p}{)}\n", "\\PY{+w}{ }\\PY{n+nf}{return}\\PY{p}{(}\\PY{n}{out}\\PY{p}{)}\n", "\\PY{p}{\\PYZcb{}}\n", "\\end{Verbatim}\n" ], "text/plain": [ "hartman6 <- function(X) {\n", " out <- tryCatch(\n", " {\n", " alpha <- c(1.0, 1.2, 3.0, 3.2)\n", " A <- c(10, 3, 17, 3.5, 1.7, 8,\n", " 0.05, 10, 17, 0.1, 8, 14,\n", " 3, 3.5, 1.7, 10, 17, 8,\n", " 17, 8, 0.05, 10, 0.1, 14)\n", " A <- matrix(A, 4, 6, byrow=TRUE)\n", " P <- 10^(-4) * c(1312, 1696, 5569, 124, 8283, 5886,\n", " 2329, 4135, 8307, 3736, 1004, 9991,\n", " 2348, 1451, 3522, 2883, 3047, 6650,\n", " 4047, 8828, 8732, 5743, 1091, 381)\n", " P <- matrix(P, 4, 6, byrow=TRUE)\n", "\n", " Xmat <- matrix(rep(X,times=4), 4, 6, byrow=TRUE)\n", " inner_sum <- rowSums(A[,1:6]*(Xmat-P[,1:6])^2)\n", " outer_sum <- sum(alpha * exp(-inner_sum))\n", " y <- -outer_sum\n", " return(y)\n", " },\n", " error=function(cond) {\n", " return(NA)\n", " }\n", " )\n", " return(out)\n", "}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Code(hartman6_path)" ] }, { "cell_type": "markdown", "id": "7733a61f-186f-4f90-ac43-fe0435acb490", "metadata": {}, "source": [ "## Running our script\n", "\n", "To run our script we just need to path the config file to BOA's CLI\n", "\n", "```python\n", "boa --config-file path/to/config.yaml\n", "```\n", "\n", "or\n", "\n", "```python\n", "boa -c path/to/config.yaml\n", "```" ] }, { "cell_type": "code", "execution_count": 7, "id": "b7c3b4bc-fee0-44a9-8444-9097336285d7", "metadata": { "tags": [ "remove-input" ] }, "outputs": [ { "data": { "text/html": [ "
[WARNING 07-13 14:30:49] 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",
       "[INFO 07-13 14:30:50] 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])], parameter_constraints=[]).\n",
       "[INFO 07-13 14:30:50] 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:50] ax.modelbridge.dispatch_utils: Calculating the number of remaining initialization trials based on num_initialization_trials=None max_initialization_trials=None num_tunable_parameters=6 num_trials=None use_batch_trials=False\n",
       "[INFO 07-13 14:30:50] ax.modelbridge.dispatch_utils: calculated num_initialization_trials=12\n",
       "[INFO 07-13 14:30:50] ax.modelbridge.dispatch_utils: num_completed_initialization_trials=0 num_remaining_initialization_trials=12\n",
       "[INFO 07-13 14:30:50] ax.modelbridge.dispatch_utils: Using Bayesian Optimization generation strategy: GenerationStrategy(name='Sobol+GPEI', steps=[Sobol for 12 trials, GPEI for subsequent trials]). Iterations after 12 will take longer to generate due to model-fitting.\n",
       "[INFO 07-13 14:30:50] 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",
       "[INFO 2023-07-13 14:30:50,865 MainProcess] boa: \n",
       "\n",
       "##############################################\n",
       "\n",
       "\n",
       "BOA Experiment Run\n",
       "Output Experiment Dir: [/path/to/your/dir/]/r_streamlined_run_20230713T143050\n",
       "Start Time: 20230713T143050\n",
       "Version: 0.8.7.dev4+gae30cf2.d20230713\n",
       "\n",
       "##############################################\n",
       "\n",
       "[INFO 07-13 14:30:50] Scheduler: Running trials [0]...\n",
       "[INFO 07-13 14:30:52] Scheduler: Running trials [1]...\n",
       "[INFO 07-13 14:30:54] 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:59] Scheduler: Running trials [5]...\n",
       "[INFO 07-13 14:31:00] Scheduler: Running trials [6]...\n",
       "[INFO 07-13 14:31:01] Scheduler: Running trials [7]...\n",
       "[INFO 07-13 14:31:04] Scheduler: Running trials [8]...\n",
       "[INFO 07-13 14:31:07] Scheduler: Running trials [9]...\n",
       "[INFO 07-13 14:31:08] Scheduler: Retrieved COMPLETED trials: 0 - 9.\n",
       "[INFO 07-13 14:31:08] Scheduler: Fetching data for trials: 0 - 9.\n",
       "[INFO 2023-07-13 14:31:08,745 MainProcess] boa: Saved JSON-serialized state of optimization to `[/path/to/your/dir/]/r_streamlined_run_20230713T143050/scheduler.json`.\n",
       "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n",
       "[INFO 2023-07-13 14:31:08,803 MainProcess] boa: Trials so far: 10\n",
       "Running trials: \n",
       "Will Produce next trials from generation step: Sobol\n",
       "Best trial so far: {9: {'metric': -0.5032}}\n",
       "[INFO 07-13 14:31:08] Scheduler: Running trials [10]...\n",
       "[INFO 07-13 14:31:09] Scheduler: Running trials [11]...\n",
       "[INFO 07-13 14:31:15] Scheduler: Running trials [12]...\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:21] Scheduler: Running trials [13]...\n",
       "[INFO 07-13 14:31:22] 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:24] Scheduler: Running trials [14]...\n",
       "[INFO 07-13 14:31:26] Scheduler: Retrieved COMPLETED trials: 10 - 14.\n",
       "[INFO 07-13 14:31:26] Scheduler: Fetching data for trials: 10 - 14.\n",
       "[INFO 2023-07-13 14:31:26,333 MainProcess] boa: Saved JSON-serialized state of optimization to `[/path/to/your/dir/]/r_streamlined_run_20230713T143050/scheduler.json`.\n",
       "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n",
       "[INFO 2023-07-13 14:31:26,360 MainProcess] boa: Trials so far: 15\n",
       "Running trials: \n",
       "Will Produce next trials from generation step: GPEI\n",
       "Best trial so far: {12: {'metric': -0.6201}}\n",
       "[INFO 2023-07-13 14:31:26,375 MainProcess] boa: Saved JSON-serialized state of optimization to `[/path/to/your/dir/]/r_streamlined_run_20230713T143050/scheduler.json`.\n",
       "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n",
       "[INFO 2023-07-13 14:31:26,400 MainProcess] boa: Trials so far: 15\n",
       "Running trials: \n",
       "Will Produce next trials from generation step: GPEI\n",
       "Best trial so far: {12: {'metric': -0.6201}}\n",
       "[INFO 2023-07-13 14:31:26,422 MainProcess] boa: \n",
       "\n",
       "##############################################\n",
       "\n",
       "Trials Completed!\n",
       "BOA Experiment Run\n",
       "Output Experiment Dir: [/path/to/your/dir/]/r_streamlined_run_20230713T143050\n",
       "Start Time: 20230713T143050\n",
       "Version: 0.8.7.dev4+gae30cf2.d20230713\n",
       "End Time: 20230713T143126\n",
       "Total Run Time: 35.53495001792908\n",
       "\n",
       "    trial_index arm_name trial_status  ...        x3        x4        x5\n",
       "0             0      0_0    COMPLETED  ...  0.755183  0.548820  0.555407\n",
       "1             1      1_0    COMPLETED  ...  0.441893  0.777394  0.218111\n",
       "2             2      2_0    COMPLETED  ...  0.833717  0.685323  0.358227\n",
       "3             3      3_0    COMPLETED  ...  0.337164  0.706950  0.410019\n",
       "4             4      4_0    COMPLETED  ...  0.842163  0.989052  0.966872\n",
       "5             5      5_0    COMPLETED  ...  0.081540  0.828128  0.128949\n",
       "6             6      6_0    COMPLETED  ...  0.138704  0.598400  0.496507\n",
       "7             7      7_0    COMPLETED  ...  0.723201  0.459715  0.961720\n",
       "8             8      8_0    COMPLETED  ...  0.614263  0.018990  0.856079\n",
       "9             9      9_0    COMPLETED  ...  0.324603  0.855542  0.100329\n",
       "10           10     10_0    COMPLETED  ...  0.955197  0.150812  0.603905\n",
       "11           11     11_0    COMPLETED  ...  0.646193  0.756861  0.555784\n",
       "12           12     12_0    COMPLETED  ...  0.301131  0.897643  0.021916\n",
       "13           13     13_0    COMPLETED  ...  0.379400  0.892975  0.053183\n",
       "14           14     14_0    COMPLETED  ...  0.280032  0.808321  0.174706\n",
       "\n",
       "[15 rows x 11 columns]\n",
       "\n",
       "##############################################\n",
       "
\n" ], "text/latex": [ "\\begin{Verbatim}[commandchars=\\\\\\{\\}]\n", "\\PY{err}{[}\\PY{n}{WARNING}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{30}\\PY{o}{:}\\PY{l+m+mi}{49}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{service}\\PY{p}{.}\\PY{n}{utils}\\PY{p}{.}\\PY{n}{with\\PYZus{}db\\PYZus{}settings\\PYZus{}base}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Ax}\\PY{+w}{ }\\PY{n}{currently}\\PY{+w}{ }\\PY{n}{requires}\\PY{+w}{ }\\PY{n}{a}\\PY{+w}{ }\\PY{n}{sqlalchemy}\\PY{+w}{ }\\PY{n}{version}\\PY{+w}{ }\\PY{n}{below}\\PY{+w}{ }\\PY{l+m+mf}{2.0}\\PY{p}{.}\\PY{+w}{ }\\PY{n}{This}\\PY{+w}{ }\\PY{n}{will}\\PY{+w}{ }\\PY{n}{be}\\PY{+w}{ }\\PY{n}{addressed}\\PY{+w}{ }\\PY{k}{in}\\PY{+w}{ }\\PY{n}{a}\\PY{+w}{ }\\PY{n}{future}\\PY{+w}{ }\\PY{k}{release}\\PY{p}{.}\\PY{+w}{ }\\PY{n}{Disabling}\\PY{+w}{ }\\PY{k}{SQL}\\PY{+w}{ }\\PY{k}{storage}\\PY{+w}{ }\\PY{k}{in}\\PY{+w}{ }\\PY{n}{Ax}\\PY{+w}{ }\\PY{k}{for}\\PY{+w}{ }\\PY{n}{now}\\PY{p}{,}\\PY{+w}{ }\\PY{k}{if}\\PY{+w}{ }\\PY{n}{you}\\PY{+w}{ }\\PY{n}{would}\\PY{+w}{ }\\PY{k}{like}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{k}{use}\\PY{+w}{ }\\PY{k}{SQL}\\PY{+w}{ }\\PY{k}{storage}\\PY{+w}{ }\\PY{n}{please}\\PY{+w}{ }\\PY{k}{install}\\PY{+w}{ }\\PY{n}{Ax}\\PY{+w}{ }\\PY{k}{with}\\PY{+w}{ }\\PY{n}{mysql}\\PY{+w}{ }\\PY{n}{extras}\\PY{+w}{ }\\PY{n}{via}\\PY{+w}{ }\\PY{n+nQuoted}{`}\\PY{n+nQuoted}{pip install ax\\PYZhy{}platform[mysql]}\\PY{n+nQuoted}{`}\\PY{p}{.}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{30}\\PY{o}{:}\\PY{l+m+mi}{50}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{service}\\PY{p}{.}\\PY{n}{utils}\\PY{p}{.}\\PY{n}{instantiation}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Created}\\PY{+w}{ }\\PY{n}{search}\\PY{+w}{ }\\PY{n}{space}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{SearchSpace}\\PY{p}{(}\\PY{n}{parameters}\\PY{o}{=}\\PY{err}{[}\\PY{n}{RangeParameter}\\PY{p}{(}\\PY{k}{name}\\PY{o}{=}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{x0}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{parameter\\PYZus{}type}\\PY{o}{=}\\PY{k+kt}{FLOAT}\\PY{p}{,}\\PY{+w}{ }\\PY{k}{range}\\PY{o}{=}\\PY{err}{[}\\PY{l+m+mf}{0.0}\\PY{p}{,}\\PY{+w}{ }\\PY{l+m+mf}{1.0}\\PY{err}{]}\\PY{p}{)}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{RangeParameter}\\PY{p}{(}\\PY{k}{name}\\PY{o}{=}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{x1}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{parameter\\PYZus{}type}\\PY{o}{=}\\PY{k+kt}{FLOAT}\\PY{p}{,}\\PY{+w}{ }\\PY{k}{range}\\PY{o}{=}\\PY{err}{[}\\PY{l+m+mf}{0.0}\\PY{p}{,}\\PY{+w}{ }\\PY{l+m+mf}{1.0}\\PY{err}{]}\\PY{p}{)}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{RangeParameter}\\PY{p}{(}\\PY{k}{name}\\PY{o}{=}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{x2}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{parameter\\PYZus{}type}\\PY{o}{=}\\PY{k+kt}{FLOAT}\\PY{p}{,}\\PY{+w}{ }\\PY{k}{range}\\P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\\PY{l+m+mf}{1.0}\\PY{err}{]}\\PY{p}{)}\\PY{err}{]}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{parameter\\PYZus{}constraints}\\PY{o}{=}\\PY{err}{[}\\PY{err}{]}\\PY{p}{)}\\PY{p}{.}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{30}\\PY{o}{:}\\PY{l+m+mi}{50}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{modelbridge}\\PY{p}{.}\\PY{n}{dispatch\\PYZus{}utils}\\PY{o}{:}\\PY{+w}{ }\\PY{k}{Using}\\PY{+w}{ }\\PY{n}{Models}\\PY{p}{.}\\PY{n}{GPEI}\\PY{+w}{ }\\PY{n}{since}\\PY{+w}{ }\\PY{n}{there}\\PY{+w}{ }\\PY{n}{are}\\PY{+w}{ }\\PY{n}{more}\\PY{+w}{ }\\PY{n}{ordered}\\PY{+w}{ }\\PY{n}{parameters}\\PY{+w}{ }\\PY{k}{than}\\PY{+w}{ }\\PY{n}{there}\\PY{+w}{ }\\PY{n}{are}\\PY{+w}{ }\\PY{n}{categories}\\PY{+w}{ }\\PY{k}{for}\\PY{+w}{ }\\PY{n}{the}\\PY{+w}{ }\\PY{n}{unordered}\\PY{+w}{ }\\PY{n}{categorical}\\PY{+w}{ }\\PY{n}{parameters}\\PY{p}{.}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{30}\\PY{o}{:}\\PY{l+m+mi}{50}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{modelbridge}\\PY{p}{.}\\PY{n}{dispatch\\PYZus{}utils}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Calculating}\\PY{+w}{ }\\PY{n}{the}\\PY{+w}{ }\\PY{k}{number}\\PY{+w}{ }\\PY{k}{of}\\PY{+w}{ }\\PY{n}{remaining}\\PY{+w}{ }\\PY{n}{initialization}\\PY{+w}{ }\\PY{n}{trials}\\PY{+w}{ }\\PY{n}{based}\\PY{+w}{ }\\PY{k}{on}\\PY{+w}{ }\\PY{n}{num\\PYZus{}initialization\\PYZus{}trials}\\PY{o}{=}\\PY{k}{None}\\PY{+w}{ }\\PY{n}{max\\PYZus{}initialization\\PYZus{}trials}\\PY{o}{=}\\PY{k}{None}\\PY{+w}{ }\\PY{n}{num\\PYZus{}tunable\\PYZus{}parameters}\\PY{o}{=}\\PY{l+m+mi}{6}\\PY{+w}{ }\\PY{n}{num\\PYZus{}trials}\\PY{o}{=}\\PY{k}{None}\\PY{+w}{ }\\PY{n}{use\\PYZus{}batch\\PYZus{}trials}\\PY{o}{=}\\PY{n+no}{False}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{30}\\PY{o}{:}\\PY{l+m+mi}{50}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{modelbridge}\\PY{p}{.}\\PY{n}{dispatch\\PYZus{}utils}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{calculated}\\PY{+w}{ }\\PY{n}{num\\PYZus{}initialization\\PYZus{}trials}\\PY{o}{=}\\PY{l+m+mi}{12}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{30}\\PY{o}{:}\\PY{l+m+mi}{50}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{modelbridge}\\PY{p}{.}\\PY{n}{dispatch\\PYZus{}utils}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{num\\PYZus{}completed\\PYZus{}initialization\\PYZus{}trials}\\PY{o}{=}\\PY{l+m+mi}{0}\\PY{+w}{ }\\PY{n}{num\\PYZus{}remaining\\PYZus{}initialization\\PYZus{}trials}\\PY{o}{=}\\PY{l+m+mi}{12}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{30}\\PY{o}{:}\\PY{l+m+mi}{50}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{modelbridge}\\PY{p}{.}\\PY{n}{dispatch\\PYZus{}utils}\\PY{o}{:}\\PY{+w}{ }\\PY{k}{Using}\\PY{+w}{ }\\PY{n}{Bayesian}\\PY{+w}{ }\\PY{n}{Optimization}\\PY{+w}{ }\\PY{n}{generation}\\PY{+w}{ }\\PY{n}{strategy}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{GenerationStrategy}\\PY{p}{(}\\PY{k}{name}\\PY{o}{=}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{Sobol+GPEI}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{steps}\\PY{o}{=}\\PY{err}{[}\\PY{n}{Sobol}\\PY{+w}{ }\\PY{k}{for}\\PY{+w}{ }\\PY{l+m+mi}{12}\\PY{+w}{ }\\PY{n}{trials}\\PY{p}{,}\\PY{+w}{ }\\PY{n}{GPEI}\\PY{+w}{ }\\PY{k}{for}\\PY{+w}{ }\\PY{n}{subsequent}\\PY{+w}{ }\\PY{n}{trials}\\PY{err}{]}\\PY{p}{)}\\PY{p}{.}\\PY{+w}{ }\\PY{n}{Iterations}\\PY{+w}{ }\\PY{k}{after}\\PY{+w}{ }\\PY{l+m+mi}{12}\\PY{+w}{ }\\PY{n}{will}\\PY{+w}{ }\\PY{n}{take}\\PY{+w}{ }\\PY{n}{longer}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n}{generate}\\PY{+w}{ }\\PY{n}{due}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n}{model}\\PY{o}{\\PYZhy{}}\\PY{n}{fitting}\\PY{p}{.}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{30}\\PY{o}{:}\\PY{l+m+mi}{50}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{Scheduler}\\PY{o}{:}\\PY{+w}{ }\\PY{n+nQuoted}{`}\\PY{n+nQuoted}{Scheduler}\\PY{n+nQuoted}{`}\\PY{+w}{ }\\PY{n}{requires}\\PY{+w}{ }\\PY{n}{experiment}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n}{have}\\PY{+w}{ }\\PY{n}{immutable}\\PY{+w}{ }\\PY{n}{search}\\PY{+w}{ }\\PY{n}{space}\\PY{+w}{ }\\PY{k}{and}\\PY{+w}{ }\\PY{n}{optimization}\\PY{+w}{ }\\PY{n}{config}\\PY{p}{.}\\PY{+w}{ }\\PY{k}{Set}\\PY{n}{ting}\\PY{+w}{ }\\PY{n}{property}\\PY{+w}{ }\\PY{n}{immutable\\PYZus{}search\\PYZus{}space\\PYZus{}and\\PYZus{}opt\\PYZus{}config}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n+nQuoted}{`}\\PY{n+nQuoted}{True}\\PY{n+nQuoted}{`}\\PY{+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 }\\PY{n}{state}\\PY{+w}{ }\\PY{k}{of}\\PY{+w}{ }\\PY{n}{optimization}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n+nQuoted}{`}\\PY{n+nQuoted}{[/path/to/your/dir/]/r\\PYZus{}streamlined\\PYZus{}run\\PYZus{}20230713T143050/scheduler.json}\\PY{n+nQuoted}{`}\\PY{p}{.}\n", "\\PY{n}{Boa}\\PY{+w}{ }\\PY{n}{version}\\PY{o}{:}\\PY{+w}{ }\\PY{l+m+mf}{0.8}\\PY{l+m+mf}{.7}\\PY{p}{.}\\PY{n}{dev4}\\PY{o}{+}\\PY{n}{gae30cf2}\\PY{p}{.}\\PY{n}{d20230713}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{2023}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{08}\\PY{p}{,}\\PY{l+m+mi}{803}\\PY{+w}{ }\\PY{n}{MainProcess}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{boa}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Trials}\\PY{+w}{ }\\PY{n}{so}\\PY{+w}{ }\\PY{n}{far}\\PY{o}{:}\\PY{+w}{ }\\PY{l+m+mi}{10}\n", "\\PY{n}{Running}\\PY{+w}{ }\\PY{n}{trials}\\PY{o}{:}\\PY{+w}{ }\n", "\\PY{n}{Will}\\PY{+w}{ }\\PY{n}{Produce}\\PY{+w}{ }\\PY{k}{next}\\PY{+w}{ }\\PY{n}{trials}\\PY{+w}{ }\\PY{k}{from}\\PY{+w}{ }\\PY{n}{generation}\\PY{+w}{ }\\PY{n}{step}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Sobol}\n", "\\PY{n}{Best}\\PY{+w}{ }\\PY{n}{trial}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}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{15}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{Scheduler}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Running}\\PY{+w}{ }\\PY{n}{trials}\\PY{+w}{ }\\PY{err}{[}\\PY{l+m+mi}{12}\\PY{err}{]}\\PY{p}{.}\\PY{p}{.}\\PY{p}{.}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{16}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{modelbridge}\\PY{p}{.}\\PY{n}{torch}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{The}\\PY{+w}{ }\\PY{n}{observations}\\PY{+w}{ }\\PY{n}{are}\\PY{+w}{ }\\PY{n}{identical}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n}{the}\\PY{+w}{ }\\PY{k}{last}\\PY{+w}{ }\\PY{k}{set}\\PY{+w}{ }\\PY{k}{of}\\PY{+w}{ }\\PY{n}{observations}\\PY{+w}{ }\\PY{n}{used}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n}{fit}\\PY{+w}{ }\\PY{n}{the}\\PY{+w}{ }\\PY{n}{model}\\PY{p}{.}\\PY{+w}{ }\\PY{n}{Skipping}\\PY{+w}{ }\\PY{n}{model}\\PY{+w}{ }\\PY{n}{fitting}\\PY{p}{.}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{21}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{Scheduler}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Running}\\PY{+w}{ }\\PY{n}{trials}\\PY{+w}{ }\\PY{err}{[}\\PY{l+m+mi}{13}\\PY{err}{]}\\PY{p}{.}\\PY{p}{.}\\PY{p}{.}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{22}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{ax}\\PY{p}{.}\\PY{n}{modelbridge}\\PY{p}{.}\\PY{n}{torch}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{The}\\PY{+w}{ }\\PY{n}{observations}\\PY{+w}{ }\\PY{n}{are}\\PY{+w}{ }\\PY{n}{identical}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n}{the}\\PY{+w}{ }\\PY{k}{last}\\PY{+w}{ }\\PY{k}{set}\\PY{+w}{ }\\PY{k}{of}\\PY{+w}{ }\\PY{n}{observations}\\PY{+w}{ }\\PY{n}{used}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n}{fit}\\PY{+w}{ }\\PY{n}{the}\\PY{+w}{ }\\PY{n}{model}\\PY{p}{.}\\PY{+w}{ }\\PY{n}{Skipping}\\PY{+w}{ }\\PY{n}{model}\\PY{+w}{ }\\PY{n}{fitting}\\PY{p}{.}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{24}\\PY{err}{]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m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{26}\\PY{p}{,}\\PY{l+m+mi}{333}\\PY{+w}{ }\\PY{n}{MainProcess}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{boa}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Saved}\\PY{+w}{ }\\PY{k+kt}{JSON}\\PY{o}{\\PYZhy{}}\\PY{n}{serialized}\\PY{+w}{ }\\PY{n}{state}\\PY{+w}{ }\\PY{k}{of}\\PY{+w}{ }\\PY{n}{optimization}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n+nQuoted}{`}\\PY{n+nQuoted}{[/path/to/your/dir/]/r\\PYZus{}streamlined\\PYZus{}run\\PYZus{}20230713T143050/scheduler.json}\\PY{n+nQuoted}{`}\\PY{p}{.}\n", "\\PY{n}{Boa}\\PY{+w}{ }\\PY{n}{version}\\PY{o}{:}\\PY{+w}{ }\\PY{l+m+mf}{0.8}\\PY{l+m+mf}{.7}\\PY{p}{.}\\PY{n}{dev4}\\PY{o}{+}\\PY{n}{gae30cf2}\\PY{p}{.}\\PY{n}{d20230713}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{2023}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{26}\\PY{p}{,}\\PY{l+m+mi}{360}\\PY{+w}{ }\\PY{n}{MainProcess}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{boa}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Trials}\\PY{+w}{ }\\PY{n}{so}\\PY{+w}{ }\\PY{n}{far}\\PY{o}{:}\\PY{+w}{ }\\PY{l+m+mi}{15}\n", "\\PY{n}{Running}\\PY{+w}{ }\\PY{n}{trials}\\PY{o}{:}\\PY{+w}{ }\n", "\\PY{n}{Will}\\PY{+w}{ }\\PY{n}{Produce}\\PY{+w}{ }\\PY{k}{next}\\PY{+w}{ }\\PY{n}{trials}\\PY{+w}{ }\\PY{k}{from}\\PY{+w}{ }\\PY{n}{generation}\\PY{+w}{ }\\PY{n}{step}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{GPEI}\n", "\\PY{n}{Best}\\PY{+w}{ }\\PY{n}{trial}\\PY{+w}{ }\\PY{n}{so}\\PY{+w}{ }\\PY{n}{far}\\PY{o}{:}\\PY{+w}{ }\\PY{err}{\\PYZob{}}\\PY{l+m+mi}{12}\\PY{o}{:}\\PY{+w}{ }\\PY{err}{\\PYZob{}}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{metric}\\PY{l+s+s1}{\\PYZsq{}}\\PY{o}{:}\\PY{+w}{ }\\PY{o}{\\PYZhy{}}\\PY{l+m+mf}{0.6201}\\PY{err}{\\PYZcb{}}\\PY{err}{\\PYZcb{}}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{2023}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{26}\\PY{p}{,}\\PY{l+m+mi}{375}\\PY{+w}{ }\\PY{n}{MainProcess}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{boa}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Saved}\\PY{+w}{ }\\PY{k+kt}{JSON}\\PY{o}{\\PYZhy{}}\\PY{n}{serialized}\\PY{+w}{ }\\PY{n}{state}\\PY{+w}{ }\\PY{k}{of}\\PY{+w}{ }\\PY{n}{optimization}\\PY{+w}{ }\\PY{k}{to}\\PY{+w}{ }\\PY{n+nQuoted}{`}\\PY{n+nQuoted}{[/path/to/your/dir/]/r\\PYZus{}streamlined\\PYZus{}run\\PYZus{}20230713T143050/scheduler.json}\\PY{n+nQuoted}{`}\\PY{p}{.}\n", "\\PY{n}{Boa}\\PY{+w}{ }\\PY{n}{version}\\PY{o}{:}\\PY{+w}{ }\\PY{l+m+mf}{0.8}\\PY{l+m+mf}{.7}\\PY{p}{.}\\PY{n}{dev4}\\PY{o}{+}\\PY{n}{gae30cf2}\\PY{p}{.}\\PY{n}{d20230713}\n", "\\PY{err}{[}\\PY{n}{INFO}\\PY{+w}{ }\\PY{l+m+mi}{2023}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{07}\\PY{o}{\\PYZhy{}}\\PY{l+m+mi}{13}\\PY{+w}{ }\\PY{l+m+mi}{14}\\PY{o}{:}\\PY{l+m+mi}{31}\\PY{o}{:}\\PY{l+m+mi}{26}\\PY{p}{,}\\PY{l+m+mi}{400}\\PY{+w}{ }\\PY{n}{MainProcess}\\PY{err}{]}\\PY{+w}{ }\\PY{n}{boa}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{Trials}\\PY{+w}{ }\\PY{n}{so}\\PY{+w}{ }\\PY{n}{far}\\PY{o}{:}\\PY{+w}{ }\\PY{l+m+mi}{15}\n", "\\PY{n}{Running}\\PY{+w}{ }\\PY{n}{trials}\\PY{o}{:}\\PY{+w}{ }\n", "\\PY{n}{Will}\\PY{+w}{ }\\PY{n}{Produce}\\PY{+w}{ }\\PY{k}{next}\\PY{+w}{ }\\PY{n}{trials}\\PY{+w}{ }\\PY{k}{from}\\PY{+w}{ }\\PY{n}{generation}\\PY{+w}{ }\\PY{n}{step}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{GPEI}\n", "\\PY{n}{Best}\\PY{+w}{ }\\PY{n}{trial}\\PY{+w}{ }\\PY{n}{so}\\PY{+w}{ }\\PY{n}{far}\\PY{o}{:}\\PY{+w}{ }\\PY{err}{\\PYZob{}}\\PY{l+m+mi}{12}\\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{ }\\PY{n}{Run}\n", "\\PY{n}{Output}\\PY{+w}{ }\\PY{n}{Experiment}\\PY{+w}{ }\\PY{n}{Dir}\\PY{o}{:}\\PY{+w}{ }\\PY{err}{[}\\PY{o}{/}\\PY{k}{path}\\PY{o}{/}\\PY{k}{to}\\PY{o}{/}\\PY{n}{your}\\PY{o}{/}\\PY{n}{dir}\\PY{o}{/}\\PY{err}{]}\\PY{o}{/}\\PY{n}{r\\PYZus{}streamlined\\PYZus{}run\\PYZus{}20230713T143050}\n", "\\PY{k}{Start}\\PY{+w}{ }\\PY{k+kt}{Time}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{20230713T143050}\n", "\\PY{n}{Version}\\PY{o}{:}\\PY{+w}{ }\\PY{l+m+mf}{0.8}\\PY{l+m+mf}{.7}\\PY{p}{.}\\PY{n}{dev4}\\PY{o}{+}\\PY{n}{gae30cf2}\\PY{p}{.}\\PY{n}{d20230713}\n", "\\PY{k}{End}\\PY{+w}{ }\\PY{k+kt}{Time}\\PY{o}{:}\\PY{+w}{ }\\PY{n}{20230713T143126}\n", "\\PY{n}{Total}\\PY{+w}{ }\\PY{n}{Run}\\PY{+w}{ }\\PY{k+kt}{Time}\\PY{o}{:}\\PY{+w}{ }\\PY{l+m+mf}{35.53495001792908}\n", "\n", "\\PY{+w}{ }\\PY{n}{trial\\PYZus{}index}\\PY{+w}{ }\\PY{n}{arm\\PYZus{}name}\\PY{+w}{ }\\PY{n}{trial\\PYZus{}status}\\PY{+w}{ }\\PY{p}{.}\\PY{p}{.}\\PY{p}{.}\\PY{+w}{ }\\PY{n}{x3}\\PY{+w}{ }\\PY{n}{x4}\\PY{+w}{ }\\PY{n}{x5}\n", "\\PY{l+m+mi}{0}\\PY{+w}{ }\\PY{l+m+mi}{0}\\PY{+w}{ }\\PY{n}{0\\PYZus{}0}\\PY{+w}{ }\\PY{n}{COMPLETED}\\PY{+w}{ }\\PY{p}{.}\\PY{p}{.}\\PY{p}{.}\\PY{+w}{ }\\PY{l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w}{ }\\PY{l+m+mi}{14}\\PY{+w}{ }\\PY{n}{14\\PYZus{}0}\\PY{+w}{ }\\PY{n}{COMPLETED}\\PY{+w}{ }\\PY{p}{.}\\PY{p}{.}\\PY{p}{.}\\PY{+w}{ }\\PY{l+m+mf}{0.280032}\\PY{+w}{ }\\PY{l+m+mf}{0.808321}\\PY{+w}{ }\\PY{l+m+mf}{0.174706}\n", "\n", "\\PY{err}{[}\\PY{l+m+mi}{15}\\PY{+w}{ }\\PY{k}{rows}\\PY{+w}{ }\\PY{n}{x}\\PY{+w}{ }\\PY{l+m+mi}{11}\\PY{+w}{ }\\PY{k}{columns}\\PY{err}{]}\n", "\n", "\\PY{c+c1}{\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}\\PYZsh{}}\n", "\\end{Verbatim}\n" ], "text/plain": [ "[WARNING 07-13 14:30:49] 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", "[INFO 07-13 14:30:50] 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])], parameter_constraints=[]).\n", "[INFO 07-13 14:30:50] 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:50] ax.modelbridge.dispatch_utils: Calculating the number of remaining initialization trials based on num_initialization_trials=None max_initialization_trials=None num_tunable_parameters=6 num_trials=None use_batch_trials=False\n", "[INFO 07-13 14:30:50] ax.modelbridge.dispatch_utils: calculated num_initialization_trials=12\n", "[INFO 07-13 14:30:50] ax.modelbridge.dispatch_utils: num_completed_initialization_trials=0 num_remaining_initialization_trials=12\n", "[INFO 07-13 14:30:50] ax.modelbridge.dispatch_utils: Using Bayesian Optimization generation strategy: GenerationStrategy(name='Sobol+GPEI', steps=[Sobol for 12 trials, GPEI for subsequent trials]). Iterations after 12 will take longer to generate due to model-fitting.\n", "[INFO 07-13 14:30:50] 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", "[INFO 2023-07-13 14:30:50,865 MainProcess] boa: \n", "\n", "##############################################\n", "\n", "\n", "BOA Experiment Run\n", "Output Experiment Dir: [/path/to/your/dir/]/r_streamlined_run_20230713T143050\n", "Start Time: 20230713T143050\n", "Version: 0.8.7.dev4+gae30cf2.d20230713\n", "\n", "##############################################\n", "\n", "[INFO 07-13 14:30:50] Scheduler: Running trials [0]...\n", "[INFO 07-13 14:30:52] Scheduler: Running trials [1]...\n", "[INFO 07-13 14:30:54] 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:59] Scheduler: Running trials [5]...\n", "[INFO 07-13 14:31:00] Scheduler: Running trials [6]...\n", "[INFO 07-13 14:31:01] Scheduler: Running trials [7]...\n", "[INFO 07-13 14:31:04] Scheduler: Running trials [8]...\n", "[INFO 07-13 14:31:07] Scheduler: Running trials [9]...\n", "[INFO 07-13 14:31:08] Scheduler: Retrieved COMPLETED trials: 0 - 9.\n", "[INFO 07-13 14:31:08] Scheduler: Fetching data for trials: 0 - 9.\n", "[INFO 2023-07-13 14:31:08,745 MainProcess] boa: Saved JSON-serialized state of optimization to `[/path/to/your/dir/]/r_streamlined_run_20230713T143050/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:08,803 MainProcess] boa: Trials so far: 10\n", "Running trials: \n", "Will Produce next trials from generation step: Sobol\n", "Best trial so far: {9: {'metric': -0.5032}}\n", "[INFO 07-13 14:31:08] Scheduler: Running trials [10]...\n", "[INFO 07-13 14:31:09] Scheduler: Running trials [11]...\n", "[INFO 07-13 14:31:15] Scheduler: Running trials [12]...\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:21] Scheduler: Running trials [13]...\n", "[INFO 07-13 14:31:22] 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:24] Scheduler: Running trials [14]...\n", "[INFO 07-13 14:31:26] Scheduler: Retrieved COMPLETED trials: 10 - 14.\n", "[INFO 07-13 14:31:26] Scheduler: Fetching data for trials: 10 - 14.\n", "[INFO 2023-07-13 14:31:26,333 MainProcess] boa: Saved JSON-serialized state of optimization to `[/path/to/your/dir/]/r_streamlined_run_20230713T143050/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:26,360 MainProcess] boa: Trials so far: 15\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {12: {'metric': -0.6201}}\n", "[INFO 2023-07-13 14:31:26,375 MainProcess] boa: Saved JSON-serialized state of optimization to `[/path/to/your/dir/]/r_streamlined_run_20230713T143050/scheduler.json`.\n", "Boa version: 0.8.7.dev4+gae30cf2.d20230713\n", "[INFO 2023-07-13 14:31:26,400 MainProcess] boa: Trials so far: 15\n", "Running trials: \n", "Will Produce next trials from generation step: GPEI\n", "Best trial so far: {12: {'metric': -0.6201}}\n", "[INFO 2023-07-13 14:31:26,422 MainProcess] boa: \n", "\n", "##############################################\n", "\n", "Trials Completed!\n", "BOA Experiment Run\n", "Output Experiment Dir: [/path/to/your/dir/]/r_streamlined_run_20230713T143050\n", "Start Time: 20230713T143050\n", "Version: 0.8.7.dev4+gae30cf2.d20230713\n", "End Time: 20230713T143126\n", "Total Run Time: 35.53495001792908\n", "\n", " trial_index arm_name trial_status ... x3 x4 x5\n", "0 0 0_0 COMPLETED ... 0.755183 0.548820 0.555407\n", "1 1 1_0 COMPLETED ... 0.441893 0.777394 0.218111\n", "2 2 2_0 COMPLETED ... 0.833717 0.685323 0.358227\n", "3 3 3_0 COMPLETED ... 0.337164 0.706950 0.410019\n", "4 4 4_0 COMPLETED ... 0.842163 0.989052 0.966872\n", "5 5 5_0 COMPLETED ... 0.081540 0.828128 0.128949\n", "6 6 6_0 COMPLETED ... 0.138704 0.598400 0.496507\n", "7 7 7_0 COMPLETED ... 0.723201 0.459715 0.961720\n", "8 8 8_0 COMPLETED ... 0.614263 0.018990 0.856079\n", "9 9 9_0 COMPLETED ... 0.324603 0.855542 0.100329\n", "10 10 10_0 COMPLETED ... 0.955197 0.150812 0.603905\n", "11 11 11_0 COMPLETED ... 0.646193 0.756861 0.555784\n", "12 12 12_0 COMPLETED ... 0.301131 0.897643 0.021916\n", "13 13 13_0 COMPLETED ... 0.379400 0.892975 0.053183\n", "14 14 14_0 COMPLETED ... 0.280032 0.808321 0.174706\n", "\n", "[15 rows x 11 columns]\n", "\n", "##############################################" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "output = !boa -c {config_path} # we capture ipython terminal output to python variable\n", "o = \"\\n\".join(ln for ln in output) # it comes in as a list, we convert to string\n", "o = o.replace(str(r_dir), \"[/path/to/your/dir/]\") # replace the actual dir with a stand in for privacy reasons\n", "Code(o)" ] }, { "cell_type": "code", "execution_count": 8, "id": "abd225cf-50b4-403f-8c79-3a136fabbb7e", "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "# These are just safety sanity checks for internal doc testing purposes\n", "\n", "# Check that the number of trials in config is the number that got ran\n", "trials_ran = int(\n", " # we look for [n rows x m columns], grab that row\n", " # then grab a regex of \"n rows\"\n", " re.search(\"\\d+ rows\", output.grep(\"\\d+ rows x \\d+ columns\")[0]).group()\n", " .split()[0] # split on the space and grab \"n\"\n", ") # cast to int\n", "assert trials_ran == total_trials \n", "\n", "# Check that the experiment name in config is the one that actually got used and written to disk\n", "# and the experiment actually got written to disk\n", "ex_save_dir = [\n", " ln for ln in output.grep(ex_name) \n", " if \"Output Experiment Dir: \" in ln\n", "][0].split()[-1]\n", "assert pathlib.Path(ex_save_dir).exists()\n", "\n", "scheduler_path = ex_save_dir + \"scheduler.json\"" ] }, { "cell_type": "code", "execution_count": null, "id": "a8c89f69-2651-4602-8a36-401c93bd6cc2", "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" } }, "nbformat": 4, "nbformat_minor": 5 }