Skip to content

Commit

Permalink
Small edits in the docs (#211)
Browse files Browse the repository at this point in the history
* typo in intro.ipynb

* replace Nelder-Mead with SOBO in comments

* replace TSEMO with SOBO in comments

* expand comments on suggest_experiments

* installation: python 3.10 is supported since 0.8.7

* docs fixed typo

* followup #138, variable name cannot be a keyword

* docs fixed broken link

* use prev_res in tsemo docs

* remove unused library in example

* replace library name in example
  • Loading branch information
ilario authored Oct 19, 2022
1 parent d107985 commit c3deffc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/source/experiments_benchmarks/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The :class:`~summit.experiment.Experiment` class provides a generic way of repre
Here, we present the already implemented benchmarks and show you how to create new onces.

.. _here: ../tutorials/new_benchmarks.ipynb
.. _tutorial: ../tutorials/tutorial.ipynb
.. _tutorial: ../tutorials/intro.ipynb

.. toctree::
implemented_benchmarks
experiment
experimental_emulator
experimental_emulator
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installation
============

Note that Summit only works with python 3.8 and 3.9 currently. We are waiting on pytorch to add python 3.10 support.
Note that Summit only works with python 3.8, 3.9 and 3.10 currently.

The easiest way to install Summit is using pip or a depedency manager that supports pip:

Expand Down
10 changes: 5 additions & 5 deletions docs/source/tutorials/intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In the above code, we start by creating the laboratory as we did before. We then setup the random strategy using `Random`and ask it for experiments using `suggest_experiments`. We run those experiments and plot the results. \n",
"In the above code, we start by creating the laboratory as we did before. We then setup the random strategy using `Random` which gets used by the runner for getting new experiments to perform using `strategy.suggest_experiments` internally. We run those experiments and plot the results. \n",
"\n",
"The above plot is a pareto plot. Each point in the above plot represents the objective values for a different set of reaction conditons. The pareto front shows the conditions that optimize space-time yield at the cost of E-factor and vice versa. "
]
Expand Down Expand Up @@ -365,7 +365,7 @@
"source": [
"exp = SnarBenchmark()\n",
"\n",
"# Since the Snar benchmark has two objectives and Nelder-Mead is single objective, \n",
"# Since the Snar benchmark has two objectives and SOBO is single objective, \n",
"# we need a multi-to-single objective transform\n",
"transform = MultitoSingleObjective(\n",
" exp.domain, expression=\"-sty/1e4+e_factor/100\", maximize=False\n",
Expand Down Expand Up @@ -758,7 +758,7 @@
}
],
"source": [
"# Load in previous TSEMO hyperparameters and internal state\n",
"# Load in previous SOBO hyperparameters and internal state\n",
"strategy = SOBO.load(FOLDER / 'snar_sobo_external.json')\n",
"\n",
"# Load in experimental results\n",
Expand Down Expand Up @@ -831,10 +831,10 @@
}
],
"source": [
"# Get experimental suggestions from TSEMO\n",
"# Get experimental suggestions from SOBO\n",
"second_experiments = strategy.suggest_experiments(1, prev_res=prev_res)\n",
"\n",
"# Save TSEMO state\n",
"# Save SOBO state\n",
"strategy.save(FOLDER / 'snar_sobo_external_2.json')\n",
"\n",
"# Save experiments to CSV\n",
Expand Down
14 changes: 7 additions & 7 deletions docs/source/tutorials/new_benchmarks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"# Objectives\n",
"des_5 = \"Yield\"\n",
"domain += ContinuousVariable(\n",
" name=\"yield\",\n",
" name=\"yld\",\n",
" description=des_5,\n",
" bounds=[0, 100],\n",
" is_objective=True,\n",
Expand Down Expand Up @@ -226,7 +226,7 @@
{
"data": {
"text/html": [
"<table id='domain' width=100%><tr><td><b>Name</b></td><td><b>Type</b></td><td><b>Description</b></td><td><b>Values</b></td></tr><tr><td>catalyst</td><td>categorical, input</td><td>Catalyst type - different ligands</td><td>8 levels</td></tr><tr><td>t_res</td><td>continuous, input</td><td>Residence time in seconds (s)</td><td>[60,600]</td></tr><tr><td>temperature</td><td>continuous, input</td><td>Reactor temperature in degrees Celsius (ºC)</td><td>[30,110]</td></tr><tr><td>catalyst_loading</td><td>continuous, input</td><td>Catalyst loading in mol%</td><td>[0.5,2.5]</td></tr><tr><td>yield</td><td>continuous, maximize objective</td><td>Yield</td><td>[0,100]</td></tr><tr><td>ton</td><td>continuous, maximize objective</td><td>Turnover number - moles product generated divided by moles catalyst used</td><td>[0,200]</td></tr></table>"
"<table id='domain' width=100%><tr><td><b>Name</b></td><td><b>Type</b></td><td><b>Description</b></td><td><b>Values</b></td></tr><tr><td>catalyst</td><td>categorical, input</td><td>Catalyst type - different ligands</td><td>8 levels</td></tr><tr><td>t_res</td><td>continuous, input</td><td>Residence time in seconds (s)</td><td>[60,600]</td></tr><tr><td>temperature</td><td>continuous, input</td><td>Reactor temperature in degrees Celsius (ºC)</td><td>[30,110]</td></tr><tr><td>catalyst_loading</td><td>continuous, input</td><td>Catalyst loading in mol%</td><td>[0.5,2.5]</td></tr><tr><td>yld</td><td>continuous, maximize objective</td><td>Yield</td><td>[0,100]</td></tr><tr><td>ton</td><td>continuous, maximize objective</td><td>Turnover number - moles product generated divided by moles catalyst used</td><td>[0,200]</td></tr></table>"
],
"text/plain": [
"<summit.domain.Domain at 0x12d073c88>"
Expand Down Expand Up @@ -276,7 +276,7 @@
"source": [
"## Train the Emulator\n",
"\n",
"Now we only need two lines train the experimental emulator! We first instantiate `ExperimentalEmulator` passing in the dataset, domain and a name for the model. Next we train it with two-fold [cross-validation](https://machinelearningmastery.com/k-fold-cross-validation/) and a test set size of 25%.\n",
"Now we only need two lines to train the experimental emulator! We first instantiate `ExperimentalEmulator` passing in the dataset, domain and a name for the model. Next we train it with two-fold [cross-validation](https://machinelearningmastery.com/k-fold-cross-validation/) and a test set size of 25%.\n",
"\n",
"This step will take some time. Change verbose to 1 if you want streaming updates of the training."
]
Expand Down Expand Up @@ -386,7 +386,7 @@
" <th>t_res</th>\n",
" <th>temperature</th>\n",
" <th>catalyst_loading</th>\n",
" <th>yield</th>\n",
" <th>yld</th>\n",
" <th>ton</th>\n",
" <th>computation_t</th>\n",
" <th>experiment_t</th>\n",
Expand All @@ -411,7 +411,7 @@
"</div>"
],
"text/plain": [
"NAME catalyst t_res temperature catalyst_loading yield ton \\\n",
"NAME catalyst t_res temperature catalyst_loading yld ton \\\n",
"TYPE DATA DATA DATA DATA DATA DATA \n",
"0 P1-L1 60 100 1.0 30.521872 29.758484 \n",
"\n",
Expand Down Expand Up @@ -491,7 +491,7 @@
" <th>t_res</th>\n",
" <th>temperature</th>\n",
" <th>catalyst_loading</th>\n",
" <th>yield</th>\n",
" <th>yld</th>\n",
" <th>ton</th>\n",
" <th>computation_t</th>\n",
" <th>experiment_t</th>\n",
Expand All @@ -516,7 +516,7 @@
"</div>"
],
"text/plain": [
"NAME catalyst t_res temperature catalyst_loading yield ton \\\n",
"NAME catalyst t_res temperature catalyst_loading yld ton \\\n",
"TYPE DATA DATA DATA DATA DATA DATA \n",
"0 P1-L1 60 100 1.0 30.521872 29.758484 \n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion summit/strategies/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class LHS(Strategy):
Examples
--------
>>> from summit.domain import Domain, ContinuousVariable
>>> from summit.strategies import Random
>>> from summit.strategies import LHS
>>> import numpy as np
>>> domain = Domain()
>>> domain += ContinuousVariable(name='temperature', description='reaction temperature in celsius', bounds=[50, 100])
Expand Down
1 change: 0 additions & 1 deletion summit/strategies/sobo.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class SOBO(Strategy):
--------
>>> from summit.domain import *
>>> from summit.strategies import SOBO
>>> import numpy as np
>>> domain = Domain()
>>> domain += ContinuousVariable(name='temperature', description='reaction temperature in celsius', bounds=[50, 100])
>>> domain += CategoricalVariable(name='flowrate_a', description='flow of reactant a in mL/min', levels=[1,2,3,4,5])
Expand Down
2 changes: 1 addition & 1 deletion summit/strategies/tsemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class TSEMO(Strategy):
>>> values = {("temperature", "DATA"): 60,("flowrate_a", "DATA"): 0.5,("flowrate_b", "DATA"): 0.5,("yield_", "DATA"): 50,("de", "DATA"): 90}
>>> previous_results = DataSet([values], columns=columns)
>>> strategy = TSEMO(domain)
>>> result = strategy.suggest_experiments(5)
>>> result = strategy.suggest_experiments(5, prev_res=previous_results)
Notes
-----
Expand Down

0 comments on commit c3deffc

Please sign in to comment.