Skip to content

Commit

Permalink
examples checked
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusMNoack committed Nov 21, 2024
1 parent dc82d68 commit dc36e9b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
15 changes: 12 additions & 3 deletions examples/MultiTaskTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"metadata": {},
"outputs": [],
"source": [
"##first install the newest version of fvgp\n",
"#!pip install fvgp~=4.5.3"
"##first, install the newest version of fvgp\n",
"#!pip install fvgp~=4.5.5"
]
},
{
Expand Down Expand Up @@ -133,9 +133,10 @@
"outputs": [],
"source": [
"#mean and standard deviation\n",
"mean = my_gp2.posterior_mean(x_pred=x_pred1d.reshape(50,1), x_out=np.array([0,1]))[\"f(x)\"]\n",
"mean = my_gp2.posterior_mean(x_pred=x_pred1d.reshape(50,1))[\"f(x)\"]\n",
"std = np.sqrt(my_gp2.posterior_covariance(x_pred=x_pred1d.reshape(50,1), x_out=np.array([0,1]))[\"v(x)\"])\n",
"\n",
"\n",
"plt.plot(x_pred1d.reshape(50,1),mean[:,0], label = \"mean task 1\")\n",
"plt.plot(x_pred1d.reshape(50,1),mean[:,1], label = \"mean task 2\")\n",
"plt.scatter(x_data,y_data1) \n",
Expand Down Expand Up @@ -508,6 +509,14 @@
"fig.show()\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "811a3337-a377-44bd-85b7-9a699c299cd0",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions examples/SingleTaskTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"id": "a1b1c026",
"metadata": {},
"source": [
"This is the new test for fvgp version 4.3.0 and later."
"This is the new test for fvgp version 4.5.5 and later."
]
},
{
Expand All @@ -23,7 +23,7 @@
"metadata": {},
"outputs": [],
"source": [
"#!pip install fvgp~=4.5.3"
"#!pip install fvgp~=4.5.5"
]
},
{
Expand Down
1 change: 1 addition & 0 deletions fvgp/gp_posterior.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def posterior_mean(self, x_pred, hyperparameters=None, x_out=None):
hyperparameters = self.prior_obj.hyperparameters

if x_out is None: x_out = self.x_out
print(x_out)
self._perform_input_checks(x_pred, x_out)
x_orig = x_pred.copy()

Expand Down

0 comments on commit dc36e9b

Please sign in to comment.