diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c34553..b5ca721 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,24 +1,34 @@ # Changes +## Version 0.22.0 - 04/09/2024 + +* `ego`: + * Save config and optim history by @relf in + * Move the DOE save after the algo the iteration (fixes #182) by @relf in +* Maintainance by @relf in + ## Version 0.21.1 - 31/07/2024 * `gp`: Fix variance gradient computation by @relf in ## Version 0.21.0 - 09/07/2024 -* Implement [TREGO algorithm](https://arxiv.org/abs/2101.06808) by @relf in -* Fix added point count in TREGO local step by @relf in -* Fix WB2S criteria scaling factor and fmin computation by @relf in +* `ego`: + * Implement [TREGO algorithm](https://arxiv.org/abs/2101.06808) by @relf in + * Fix added point count in TREGO local step by @relf in + * Fix WB2S criteria scaling factor and fmin computation by @relf in * Prepare release 0.21 by @relf in ## Version 0.20.0 - 25/06/2024 -* Make `n_optmod` option available in Python by @relf in +* `gp`: + * Save original parameters in trained `gp` models by @relf in + * Implement cross validation metric for surrogates by @relf in +* `ego`: + * Make `n_optmod` option available in Python by @relf in + * Better `Egor` solver state handling by @relf in + * Refactor `ego` module by @relf in * Add dependabot cargo ecosystem check by @relf in -* Save original parameters in trained `gp` models by @relf in -* Implement cross validation metric for surrogates by @relf in -* Better `Egor` solver state handling by @relf in -* Refactor `ego` module by @relf in ## Version 0.19.0 - 15/05/2024 diff --git a/Cargo.toml b/Cargo.toml index 691a915..ca50e9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "egobox" -version = "0.21.1" +version = "0.22.0" authors = ["Rémi Lafage "] edition = "2021" description = "A toolbox for efficient global optimization" @@ -31,10 +31,10 @@ persistent-moe = ["egobox-moe/persistent"] blas = ["ndarray/blas", "egobox-gp/blas", "egobox-moe/blas", "egobox-ego/blas"] [dependencies] -egobox-doe = { version = "0.21.1", path = "./doe" } -egobox-gp = { version = "0.21.1", path = "./gp" } -egobox-moe = { version = "0.21.1", path = "./moe", features = ["persistent"] } -egobox-ego = { version = "0.21.1", path = "./ego", features = ["persistent"] } +egobox-doe = { version = "0.22.0", path = "./doe" } +egobox-gp = { version = "0.22.0", path = "./gp" } +egobox-moe = { version = "0.22.0", path = "./moe", features = ["persistent"] } +egobox-ego = { version = "0.22.0", path = "./ego", features = ["persistent"] } linfa = { version = "0.7", default-features = false } diff --git a/doc/Egor_Tutorial.ipynb b/doc/Egor_Tutorial.ipynb index 87fa6b8..1ae93fd 100644 --- a/doc/Egor_Tutorial.ipynb +++ b/doc/Egor_Tutorial.ipynb @@ -28,7 +28,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Requirement already satisfied: egobox in d:\\rlafage\\miniconda3\\lib\\site-packages (0.20.0)\n", + "Requirement already satisfied: egobox in d:\\rlafage\\miniconda3\\lib\\site-packages (0.21.1)\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "id": "0edaf00f", "metadata": {}, "outputs": [], @@ -67,7 +67,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "id": "af2d82be", "metadata": {}, "outputs": [], @@ -97,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "7f6da807", "metadata": {}, "outputs": [], @@ -113,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "id": "4c436437", "metadata": {}, "outputs": [], @@ -163,61 +163,13 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "egor = egx.Egor(xspecs_xsinx, n_cstr=n_cstr_xsinx) # see help(egor) for options" ] }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Optimization f=[-15.12510315] at [18.93488354]\n", - "Optimization history: \n", - "Inputs = [[ 2.21153062]\n", - " [18.77163578]\n", - " [13.74920548]\n", - " [21.72833442]\n", - " [ 5.97804153]\n", - " [18.98973962]\n", - " [18.92227667]\n", - " [18.93389886]\n", - " [18.93605442]\n", - " [18.93572528]\n", - " [18.93622111]\n", - " [18.93402074]\n", - " [18.93488354]]\n", - "Outputs = [[ 0.51375253]\n", - " [-15.10305227]\n", - " [ -1.23540814]\n", - " [ -8.43243768]\n", - " [ 1.75816467]\n", - " [-15.12263089]\n", - " [-15.12496448]\n", - " [-15.12510181]\n", - " [-15.12510265]\n", - " [-15.12510302]\n", - " [-15.12510239]\n", - " [-15.12510206]\n", - " [-15.12510315]]\n" - ] - } - ], - "source": [ - "res = egor.minimize(xsinx, max_iters=8)\n", - "print(f\"Optimization f={res.y_opt} at {res.x_opt}\")\n", - "print(\"Optimization history: \")\n", - "print(f\"Inputs = {res.x_hist}\")\n", - "print(f\"Outputs = {res.y_hist}\")" - ] - }, { "cell_type": "code", "execution_count": 7, @@ -252,40 +204,38 @@ "name": "stdout", "output_type": "stream", "text": [ - "Optimization f=[-5.50831454e+00 2.56893605e-04 3.19183821e-04] at [2.32952504 3.1787895 ]\n", + "Optimization f=[-5.50793692e+00 -1.35143852e-04 -5.26158286e-05] at [2.32952661 3.17841031]\n", "Optimization history: \n", - "Inputs = [[2.116192 3.17847263]\n", - " [2.61297469 3.84215954]\n", - " [0.20495463 0.12974765]\n", - " [1.74609049 1.41520332]\n", - " [0.78690036 2.06000352]\n", - " [1.23901499 2.66900549]\n", - " [2.74669922 1.80741418]\n", - " [1.08051143 0.90562675]\n", - " [1.83948014 0.69215265]\n", - " [0.30207292 3.26147058]\n", - " [2.33183324 3.22166327]\n", - " [1.84609049 1.51520332]\n", - " [1.9572016 1.62631444]\n", - " [2.08065839 1.74977119]\n", - " [2.2178326 1.8869454 ]\n", - " [2.32952504 3.1787895 ]]\n", - "Outputs = [[-5.29466464e+00 1.05755418e+00 -7.14251779e-01]\n", - " [-6.45513422e+00 -3.28864510e+00 2.28334718e+00]\n", - " [-3.34702283e-01 -2.14095739e+00 -1.96227280e+01]\n", - " [-3.16129381e+00 -9.77913316e-01 -2.08566190e+00]\n", - " [-2.84690389e+00 -1.76247506e+00 1.17033681e+00]\n", - " [-3.90802047e+00 -1.10900911e+00 1.96037216e+00]\n", - " [-4.55411340e+00 -8.60544460e+00 1.02440059e+00]\n", - " [-1.98613818e+00 -3.06852892e+00 8.10095347e-01]\n", - " [-2.53163279e+00 -1.48221975e+00 -3.10437001e+00]\n", - " [-3.56354351e+00 7.35342282e-01 -1.09206279e+01]\n", - " [-5.55349650e+00 2.41930062e-02 5.40698847e-02]\n", - " [-3.36129381e+00 -6.46257395e-01 -2.29753609e+00]\n", - " [-3.58351604e+00 -3.87718747e-01 -2.35904536e+00]\n", - " [-3.83042958e+00 -3.06557634e-01 -2.19835191e+00]\n", - " [-4.10477800e+00 -5.79857215e-01 -1.74245267e+00]\n", - " [-5.50831454e+00 2.56893605e-04 3.19183821e-04]]\n" + "Inputs = [[1.55335241 0.36609899]\n", + " [0.48433871 1.59588025]\n", + " [2.93418005 2.74753497]\n", + " [2.58045769 1.77813431]\n", + " [1.06805821 2.89510289]\n", + " [1.48471388 3.81690289]\n", + " [2.37071614 1.10296966]\n", + " [0.82720969 0.44451136]\n", + " [2.08425444 3.41673721]\n", + " [0.08617534 2.39265705]\n", + " [2.24213008 3.99999996]\n", + " [2.47071614 1.20296966]\n", + " [2.58182726 1.31408077]\n", + " [2.63287837 1.43753756]\n", + " [2.32952661 3.17841031]]\n", + "Outputs = [[-1.91945140e+00 -2.59662097e+00 -2.19714000e+00]\n", + " [-2.08021896e+00 -1.48190609e+00 -5.13533364e+00]\n", + " [-5.68171502e+00 -1.42792021e+01 2.68270603e+00]\n", + " [-4.35859200e+00 -4.70895411e+00 1.94930315e-02]\n", + " [-3.96316111e+00 -1.08641233e+00 2.82595019e+00]\n", + " [-5.30161677e+00 6.46292378e-01 1.65905814e+00]\n", + " [-3.47368580e+00 -2.44182980e+00 -1.87313519e+00]\n", + " [-1.27172105e+00 -3.43784549e+00 -1.19300768e-01]\n", + " [-5.50099165e+00 1.35506108e+00 -5.26673877e-01]\n", + " [-2.47883239e+00 3.38256872e-01 -2.59677570e+01]\n", + " [-6.24213005e+00 1.41054706e+00 4.55267296e-01]\n", + " [-3.67368580e+00 -3.50219615e+00 -1.22082043e+00]\n", + " [-3.89590802e+00 -5.19899351e+00 -4.36126757e-01]\n", + " [-4.07041593e+00 -6.11551899e+00 1.04566960e-04]\n", + " [-5.50793692e+00 -1.35143852e-04 -5.26158286e-05]]\n" ] } ], @@ -293,8 +243,8 @@ "res = egor.minimize(g24, max_iters=30)\n", "print(f\"Optimization f={res.y_opt} at {res.x_opt}\")\n", "print(\"Optimization history: \")\n", - "print(f\"Inputs = {res.x_hist}\")\n", - "print(f\"Outputs = {res.y_hist}\")" + "print(f\"Inputs = {res.x_doe}\")\n", + "print(f\"Outputs = {res.y_doe}\")" ] }, { @@ -399,16 +349,18 @@ "text": [ "Optimization f=[-15.12161154] at [19.]\n", "Optimization history: \n", - "Inputs = [[14.]\n", - " [ 2.]\n", + "Inputs = [[22.]\n", + " [ 1.]\n", + " [ 9.]\n", + " [25.]\n", " [21.]\n", - " [22.]\n", " [20.]\n", " [19.]]\n", - "Outputs = [[ -2.09283123]\n", - " [ 0.68929352]\n", + "Outputs = [[ -7.10960014]\n", + " [ 1.78601478]\n", + " [ 5.41123083]\n", + " [ 11.42919546]\n", " [-11.44370682]\n", - " [ -7.10960014]\n", " [-14.15453288]\n", " [-15.12161154]]\n" ] @@ -423,8 +375,8 @@ "res = egor.minimize(mixint_xsinx, max_iters=30)\n", "print(f\"Optimization f={res.y_opt} at {res.x_opt}\")\n", "print(\"Optimization history: \")\n", - "print(f\"Inputs = {res.x_hist}\")\n", - "print(f\"Outputs = {res.y_hist}\")" + "print(f\"Inputs = {res.x_doe}\")\n", + "print(f\"Outputs = {res.y_doe}\")" ] }, { @@ -553,8 +505,8 @@ "res = egor.minimize(mixobj, max_iters=10)\n", "print(f\"Optimization f={res.y_opt} at {res.x_opt}\")\n", "print(\"Optimization history: \")\n", - "print(f\"Inputs = {res.x_hist}\")\n", - "print(f\"Outputs = {res.y_hist}\")" + "print(f\"Inputs = {res.x_doe}\")\n", + "print(f\"Outputs = {res.y_doe}\")" ] }, { @@ -585,7 +537,7 @@ "Help on Egor in module builtins object:\n", "\n", "class Egor(object)\n", - " | Egor(xspecs, n_cstr=0, cstr_tol=None, n_start=20, n_doe=0, doe=None, regr_spec=Ellipsis, corr_spec=Ellipsis, infill_strategy=Ellipsis, q_points=1, par_infill_strategy=Ellipsis, infill_optimizer=Ellipsis, kpls_dim=None, trego=False, n_clusters=1, n_optmod=1, target=Ellipsis, outdir=None, hot_start=False, seed=None)\n", + " | Egor(xspecs, n_cstr=0, cstr_tol=None, n_start=20, n_doe=0, doe=None, regr_spec=Ellipsis, corr_spec=Ellipsis, infill_strategy=Ellipsis, q_points=1, par_infill_strategy=Ellipsis, infill_optimizer=Ellipsis, kpls_dim=None, trego=False, n_clusters=1, n_optmod=1, target=Ellipsis, outdir=None, warm_start=False, seed=None)\n", " | \n", " | Optimizer constructor\n", " | \n", @@ -681,9 +633,9 @@ " | Known optimum used as stopping criterion.\n", " | \n", " | outdir (String)\n", - " | Directory to write optimization history and used as search path for hot start doe\n", + " | Directory to write optimization history and used as search path for warm start doe\n", " | \n", - " | hot_start (bool)\n", + " | warm_start (bool)\n", " | Start by loading initial doe from directory\n", " | \n", " | seed (int >= 0)\n", diff --git a/doe/Cargo.toml b/doe/Cargo.toml index 304b2c7..57fb760 100644 --- a/doe/Cargo.toml +++ b/doe/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "egobox-doe" -version = "0.21.1" +version = "0.22.0" authors = ["Rémi Lafage "] edition = "2021" description = "A library for design of experiments" diff --git a/ego/Cargo.toml b/ego/Cargo.toml index b05047c..b80df67 100644 --- a/ego/Cargo.toml +++ b/ego/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "egobox-ego" -version = "0.21.1" +version = "0.22.0" authors = ["Rémi Lafage "] edition = "2021" description = "A library for efficient global optimization" @@ -16,11 +16,11 @@ persistent = ["egobox-moe/persistent"] blas = ["ndarray-linalg", "linfa/ndarray-linalg", "linfa-pls/blas"] [dependencies] -egobox-doe = { version = "0.21.1", path = "../doe", features = [ +egobox-doe = { version = "0.22.0", path = "../doe", features = [ "serializable", ] } -egobox-gp = { version = "0.21.1", path = "../gp", features = ["serializable"] } -egobox-moe = { version = "0.21.1", path = "../moe", features = [ +egobox-gp = { version = "0.22.0", path = "../gp", features = ["serializable"] } +egobox-moe = { version = "0.22.0", path = "../moe", features = [ "serializable", ] } diff --git a/gp/Cargo.toml b/gp/Cargo.toml index 520e052..71364bc 100644 --- a/gp/Cargo.toml +++ b/gp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "egobox-gp" -version = "0.21.1" +version = "0.22.0" authors = ["Rémi Lafage "] edition = "2021" description = "A library for gaussian process modeling" @@ -18,7 +18,7 @@ persistent = ["serializable", "serde_json"] blas = ["ndarray-linalg", "linfa/ndarray-linalg", "linfa-pls/blas"] [dependencies] -egobox-doe = { version = "0.21.1", path = "../doe" } +egobox-doe = { version = "0.22.0", path = "../doe" } linfa = { version = "0.7", default-features = false } linfa-pls = { version = "0.7", default-features = false } diff --git a/moe/Cargo.toml b/moe/Cargo.toml index 087f1df..ac85746 100644 --- a/moe/Cargo.toml +++ b/moe/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "egobox-moe" -version = "0.21.1" +version = "0.22.0" authors = ["Rémi Lafage "] edition = "2021" description = "A library for mixture of expert gaussian processes" @@ -29,8 +29,8 @@ serializable = [ blas = ["ndarray-linalg", "linfa/ndarray-linalg", "linfa-pls/blas"] [dependencies] -egobox-doe = { version = "0.21.1", path = "../doe" } -egobox-gp = { version = "0.21.1", path = "../gp" } +egobox-doe = { version = "0.22.0", path = "../doe" } +egobox-gp = { version = "0.22.0", path = "../gp" } linfa = { version = "0.7", default-features = false } linfa-clustering = { version = "0.7", default-features = false } diff --git a/pyproject.toml b/pyproject.toml index 316b1fb..56e6701 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ python-source = "python" [tool.poetry] name = "egobox" -version = "0.21.1" +version = "0.22.0" description = "Python binding for egobox EGO optimizer written in Rust" authors = ["Rémi Lafage "] packages = [{ include = "egobox", from = "python" }]