Skip to content

Commit 09b6cde

Browse files
committed
Update notebook
1 parent 40b9e65 commit 09b6cde

File tree

1 file changed

+55
-59
lines changed

1 file changed

+55
-59
lines changed

doc/Egor_Tutorial.ipynb

+55-59
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": 13,
23+
"execution_count": 1,
2424
"id": "1504e619-5775-42d3-8f48-7339272303ec",
2525
"metadata": {},
2626
"outputs": [
@@ -48,7 +48,7 @@
4848
},
4949
{
5050
"cell_type": "code",
51-
"execution_count": 14,
51+
"execution_count": 2,
5252
"id": "0edaf00f",
5353
"metadata": {},
5454
"outputs": [],
@@ -67,7 +67,7 @@
6767
},
6868
{
6969
"cell_type": "code",
70-
"execution_count": 15,
70+
"execution_count": 3,
7171
"id": "af2d82be",
7272
"metadata": {},
7373
"outputs": [],
@@ -97,7 +97,7 @@
9797
},
9898
{
9999
"cell_type": "code",
100-
"execution_count": 16,
100+
"execution_count": 4,
101101
"id": "7f6da807",
102102
"metadata": {},
103103
"outputs": [],
@@ -113,7 +113,7 @@
113113
},
114114
{
115115
"cell_type": "code",
116-
"execution_count": 17,
116+
"execution_count": 5,
117117
"id": "4c436437",
118118
"metadata": {},
119119
"outputs": [],
@@ -163,7 +163,7 @@
163163
},
164164
{
165165
"cell_type": "code",
166-
"execution_count": 18,
166+
"execution_count": 6,
167167
"id": "c8942031",
168168
"metadata": {},
169169
"outputs": [],
@@ -186,40 +186,42 @@
186186
},
187187
{
188188
"cell_type": "code",
189-
"execution_count": 19,
189+
"execution_count": 7,
190190
"id": "c12b8e9d",
191191
"metadata": {},
192192
"outputs": [
193193
{
194194
"name": "stdout",
195195
"output_type": "stream",
196196
"text": [
197-
"Optimization f=[-5.50823898e+00 -1.02637525e-03 7.31165162e-04] at [2.32965679 3.1785822 ]\n",
197+
"Optimization f=[-5.50824617e+00 -7.95284675e-04 6.47968481e-04] at [2.32963236 3.17861381]\n",
198198
"Optimization history: \n",
199-
"Inputs = [[1.00714219 2.83680177]\n",
200-
" [2.01726227 0.97229664]\n",
201-
" [0.64443743 1.49235589]\n",
202-
" [2.98520626 2.47781049]\n",
203-
" [0.51144494 3.69603895]\n",
204-
" [1.39143602 0.0521766 ]\n",
205-
" [2.19062703 2.07848306]\n",
206-
" [1.79749186 0.5511925 ]\n",
207-
" [0.04433832 3.41661282]\n",
208-
" [2.42351384 1.66930727]\n",
209-
" [2.31595596 3.18731429]\n",
210-
" [2.32965679 3.1785822 ]]\n",
211-
"Outputs = [[-3.84394396e+00 -1.16299419e+00 2.83599142e+00]\n",
212-
" [-2.98955891e+00 -1.03012858e+00 -3.02531983e+00]\n",
213-
" [-2.13679332e+00 -2.03391158e+00 -1.31360327e+00]\n",
214-
" [-5.46301675e+00 -1.68216678e+01 2.47436043e+00]\n",
215-
" [-4.20748389e+00 5.36841086e-01 -2.21660239e+00]\n",
216-
" [-1.44361262e+00 -3.38188883e+00 -1.53365927e+00]\n",
217-
" [-4.26911010e+00 -2.70284316e-01 -1.63608961e+00]\n",
218-
" [-2.34868436e+00 -1.71380930e+00 -3.12745825e+00]\n",
219-
" [-3.46095114e+00 1.40157532e+00 -2.84971328e+01]\n",
220-
" [-4.09282111e+00 -2.43765241e+00 -1.02446667e+00]\n",
221-
" [-5.50327026e+00 1.16427163e-01 -5.39230013e-02]\n",
222-
" [-5.50823898e+00 -1.02637525e-03 7.31165162e-04]]\n"
199+
"Inputs = [[0.66184897 2.45802764]\n",
200+
" [2.94696227 1.49936514]\n",
201+
" [2.66287314 3.71330294]\n",
202+
" [1.07318211 3.444229 ]\n",
203+
" [2.06760611 1.75841534]\n",
204+
" [0.14141683 2.10079958]\n",
205+
" [1.57930634 1.02835549]\n",
206+
" [0.3407986 2.9653506 ]\n",
207+
" [2.18153079 0.50856397]\n",
208+
" [1.34918822 0.06305872]\n",
209+
" [2.33240124 3.23757637]\n",
210+
" [2.32971674 3.17878826]\n",
211+
" [2.32963236 3.17861381]]\n",
212+
"Outputs = [[-3.11987661e+00 -1.11073796e+00 -4.24705019e-02]\n",
213+
" [-4.44632740e+00 -1.60762244e+01 1.45671259e+00]\n",
214+
" [-6.37617608e+00 -4.51818544e+00 2.45621708e+00]\n",
215+
" [-4.51741111e+00 -5.34405876e-01 3.36469531e+00]\n",
216+
" [-3.82602145e+00 -2.80663119e-01 -2.20510354e+00]\n",
217+
" [-2.24221641e+00 -3.73648365e-02 -2.19941708e+01]\n",
218+
" [-2.60766182e+00 -1.85451031e+00 -1.68107140e+00]\n",
219+
" [-3.30614921e+00 3.25875236e-01 -9.32597400e+00]\n",
220+
" [-2.69009477e+00 -1.80509181e+00 -3.23215231e+00]\n",
221+
" [-1.41224694e+00 -3.47894665e+00 -1.26609215e+00]\n",
222+
" [-5.56997761e+00 3.54176911e-02 7.26683768e-02]\n",
223+
" [-5.50850501e+00 -1.31019580e-03 1.21913458e-03]\n",
224+
" [-5.50824617e+00 -7.95284675e-04 6.47968481e-04]]\n"
223225
]
224226
}
225227
],
@@ -251,12 +253,12 @@
251253
},
252254
{
253255
"cell_type": "code",
254-
"execution_count": 20,
256+
"execution_count": 8,
255257
"id": "6948efc1",
256258
"metadata": {},
257259
"outputs": [],
258260
"source": [
259-
"xspecs_mixint_xsinx = [egx.XSpec(egx.XType(egx.XType.INT), [0, 25])]\n",
261+
"xspecs_mixint_xsinx = [egx.XSpec(egx.XType.INT, [0, 25])]\n",
260262
"n_cstr_mixint_xsinx = 0\n",
261263
"\n",
262264
"def mixint_xsinx(x: np.ndarray) -> np.ndarray:\n",
@@ -279,7 +281,7 @@
279281
},
280282
{
281283
"cell_type": "code",
282-
"execution_count": 21,
284+
"execution_count": 9,
283285
"id": "928d1f38",
284286
"metadata": {},
285287
"outputs": [
@@ -289,19 +291,13 @@
289291
"text": [
290292
"Optimization f=[-15.12161154] at [19.]\n",
291293
"Optimization history: \n",
292-
"Inputs = [[10.]\n",
293-
" [ 7.]\n",
294-
" [22.]\n",
295-
" [25.]\n",
296-
" [21.]\n",
297-
" [20.]\n",
294+
"Inputs = [[20.]\n",
295+
" [ 2.]\n",
296+
" [12.]\n",
298297
" [19.]]\n",
299-
"Outputs = [[ 5.70983099]\n",
300-
" [ 3.14127616]\n",
301-
" [ -7.10960014]\n",
302-
" [ 11.42919546]\n",
303-
" [-11.44370682]\n",
304-
" [-14.15453288]\n",
298+
"Outputs = [[-14.15453288]\n",
299+
" [ 0.68929352]\n",
300+
" [ 3.58937619]\n",
305301
" [-15.12161154]]\n"
306302
]
307303
}
@@ -349,7 +345,7 @@
349345
},
350346
{
351347
"cell_type": "code",
352-
"execution_count": 22,
348+
"execution_count": 10,
353349
"id": "f1615d5c",
354350
"metadata": {},
355351
"outputs": [],
@@ -385,7 +381,7 @@
385381
},
386382
{
387383
"cell_type": "code",
388-
"execution_count": 23,
384+
"execution_count": 11,
389385
"id": "d14fff89",
390386
"metadata": {},
391387
"outputs": [
@@ -436,10 +432,10 @@
436432
],
437433
"source": [
438434
"xtypes = [\n",
439-
" egx.XSpec(egx.XType(egx.XType.FLOAT), [-5.0, 5.0]),\n",
440-
" egx.XSpec(egx.XType(egx.XType.ENUM), tags=[\"blue\", \"red\", \"green\"]),\n",
441-
" egx.XSpec(egx.XType(egx.XType.ENUM), xlimits=[2]),\n",
442-
" egx.XSpec(egx.XType(egx.XType.ORD), [0, 2, 3]),\n",
435+
" egx.XSpec(egx.XType.FLOAT, [-5.0, 5.0]),\n",
436+
" egx.XSpec(egx.XType.ENUM, tags=[\"blue\", \"red\", \"green\"]),\n",
437+
" egx.XSpec(egx.XType.ENUM, xlimits=[2]),\n",
438+
" egx.XSpec(egx.XType.ORD, [0, 2, 3]),\n",
443439
"]\n",
444440
"egor = egx.Egor(mixobj, xtypes, seed=42)\n",
445441
"res = egor.minimize(n_iter=10)\n",
@@ -467,7 +463,7 @@
467463
},
468464
{
469465
"cell_type": "code",
470-
"execution_count": 24,
466+
"execution_count": 12,
471467
"id": "b91f14f2",
472468
"metadata": {},
473469
"outputs": [
@@ -478,7 +474,7 @@
478474
"Help on Egor in module builtins object:\n",
479475
"\n",
480476
"class Egor(object)\n",
481-
" | Egor(fun, n_cstr=0, n_start=20, n_doe=0, regression_spec=7, correlation_spec=15, infill_strategy=1, q_points=1, par_infill_strategy=1, infill_optimizer=1, n_clusters=1)\n",
477+
" | Egor(fun, 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, n_clusters=1, target=Ellipsis, outdir=None, hot_start=False, seed=None)\n",
482478
" | \n",
483479
" | Optimizer constructor\n",
484480
" | \n",
@@ -494,9 +490,9 @@
494490
" | n_cstr (int):\n",
495491
" | the number of constraint functions.\n",
496492
" | \n",
497-
" | cstr_tol (list(n_cstr)):\n",
498-
" | List of tolerances for constraints to be satisfied (cstr < tol), its size shoulb equalt to n_cstr.\n",
499-
" | None by default meaning zero tolerances.\n",
493+
" | cstr_tol (list(n_cstr,)):\n",
494+
" | List of tolerances for constraints to be satisfied (cstr < tol), list size should be equal to n_cstr.\n",
495+
" | None by default means zero tolerances.\n",
500496
" | \n",
501497
" | xspecs (list(XSpec)) where XSpec(xtype=FLOAT|INT|ORD|ENUM, xlimits=[<f(xtype)>] or tags=[strings]):\n",
502498
" | Specifications of the nx components of the input x (eg. len(xspecs) == nx)\n",
@@ -575,7 +571,7 @@
575571
" | \n",
576572
" | Methods defined here:\n",
577573
" | \n",
578-
" | minimize(self, /, n_iter=Ellipsis)\n",
574+
" | minimize(self, /, n_iter=20)\n",
579575
" | This function finds the minimum of a given function `fun`\n",
580576
" | \n",
581577
" | # Parameters\n",

0 commit comments

Comments
 (0)