Skip to content

Commit

Permalink
work on docstrings and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusMNoack committed Nov 10, 2023
1 parent 31e26e8 commit 6ed4bf7
Show file tree
Hide file tree
Showing 16 changed files with 661 additions and 247,499 deletions.
201 changes: 104 additions & 97 deletions docs/source/examples/1dSingleTaskAcqFuncTest.ipynb

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions docs/source/examples/GPONonEuclideanInputSpaces.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,42 +39,41 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "b91e69d3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"differential_evolution step 1: f(x)= 10.1306\n",
"differential_evolution step 2: f(x)= 8.85223\n",
"differential_evolution step 3: f(x)= 8.85223\n",
"differential_evolution step 4: f(x)= 8.85223\n",
"differential_evolution step 5: f(x)= 8.72559\n",
"differential_evolution step 6: f(x)= 8.72559\n",
"differential_evolution step 7: f(x)= 8.10705\n",
"differential_evolution step 8: f(x)= 8.10705\n",
"differential_evolution step 9: f(x)= 8.10705\n",
"differential_evolution step 10: f(x)= 8.10705\n",
"differential_evolution step 11: f(x)= 8.10705\n",
"differential_evolution step 12: f(x)= 8.10705\n",
"differential_evolution step 13: f(x)= 8.066\n",
"differential_evolution step 14: f(x)= 8.04529\n",
"differential_evolution step 15: f(x)= 8.04529\n",
"differential_evolution step 16: f(x)= 8.04529\n",
"differential_evolution step 17: f(x)= 8.04529\n",
"differential_evolution step 18: f(x)= 8.04529\n",
"differential_evolution step 19: f(x)= 8.04529\n",
"differential_evolution step 20: f(x)= 8.04497\n",
"differential_evolution step 1: f(x)= 9.9004\n",
"differential_evolution step 2: f(x)= 9.9004\n",
"differential_evolution step 3: f(x)= 8.61371\n",
"differential_evolution step 4: f(x)= 8.61371\n",
"differential_evolution step 5: f(x)= 8.61371\n",
"differential_evolution step 6: f(x)= 8.61371\n",
"differential_evolution step 7: f(x)= 8.37801\n",
"differential_evolution step 8: f(x)= 8.15879\n",
"differential_evolution step 9: f(x)= 8.06504\n",
"differential_evolution step 10: f(x)= 8.06504\n",
"differential_evolution step 11: f(x)= 8.06504\n",
"differential_evolution step 12: f(x)= 8.04906\n",
"differential_evolution step 13: f(x)= 8.04906\n",
"differential_evolution step 14: f(x)= 8.04711\n",
"differential_evolution step 15: f(x)= 8.04711\n",
"differential_evolution step 16: f(x)= 8.0449\n",
"differential_evolution step 17: f(x)= 8.0449\n",
"differential_evolution step 18: f(x)= 8.0449\n",
"differential_evolution step 19: f(x)= 8.04489\n",
"differential_evolution step 20: f(x)= 8.04489\n",
"differential_evolution step 21: f(x)= 8.04489\n",
"differential_evolution step 22: f(x)= 8.04489\n",
"differential_evolution step 23: f(x)= 8.04489\n",
"differential_evolution step 24: f(x)= 8.04489\n",
"differential_evolution step 25: f(x)= 8.04489\n",
"hyperparameters: [1.43588541 0.11134392]\n",
"prediction : [2.74]\n",
"uncertainty: [1.19828436]\n"
"hyperparameters: [1.43528892 0.26608513]\n",
"prediction : [2.73999995]\n",
"uncertainty: [1.19803544]\n"
]
}
],
Expand Down Expand Up @@ -109,10 +108,11 @@
" return hps[0] * obj.matern_kernel_diff1(d,hps[1])\n",
" \n",
"\n",
"bounds = np.array([[0.001,100.],[0.001,100]])\n",
"\n",
"my_gp = GPOptimizer(x_data,y_data, init_hyperparameters=np.ones((2)),\n",
" gp_kernel_function=kernel,hyperparameter_bounds=bounds, info = True)\n",
"my_gp.train()\n",
" gp_kernel_function=kernel, info = True)\n",
"bounds = np.array([[0.001,100.],[0.001,100]])\n",
"my_gp.train(hyperparameter_bounds=bounds)\n",
"\n",
"print(\"hyperparameters: \", my_gp.hyperparameters)\n",
"print(\"prediction : \",my_gp.posterior_mean({'full'})[\"f(x)\"])\n",
Expand All @@ -121,7 +121,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "a5644ec5",
"metadata": {},
"outputs": [
Expand All @@ -130,13 +130,13 @@
"text/plain": [
"{'x': array([['me'],\n",
" ['it'],\n",
" ['is'],\n",
" ['world']], dtype='<U5'),\n",
" 'f(x)': array([1.43588541, 1.43588541, 0.02688694, 0.02688694]),\n",
" ['hello'],\n",
" ['is']], dtype='<U5'),\n",
" 'f(x)': array([1.43528892, 1.43511274, 0.02688673, 0.02688673]),\n",
" 'opt_obj': None}"
]
},
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
Loading

0 comments on commit 6ed4bf7

Please sign in to comment.