From 85687d679f35e22707ea6dfc02c9286fd9c0929c Mon Sep 17 00:00:00 2001 From: FelixLehn <70092091+FelixLehn@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:25:42 +0100 Subject: [PATCH] Implement evaluation mode for model evaluations (#705) * Code Update 05_torch_connector.ipynb * Typo 05_torch_connector.ipynb * Update docs/tutorials/05_torch_connector.ipynb Co-authored-by: Anton Dekusar <62334182+adekusar-drl@users.noreply.github.com> --------- Co-authored-by: Anton Dekusar <62334182+adekusar-drl@users.noreply.github.com> --- docs/tutorials/05_torch_connector.ipynb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/tutorials/05_torch_connector.ipynb b/docs/tutorials/05_torch_connector.ipynb index 6ee62c8a3..0a4abcb7f 100644 --- a/docs/tutorials/05_torch_connector.ipynb +++ b/docs/tutorials/05_torch_connector.ipynb @@ -321,6 +321,7 @@ ], "source": [ "# Evaluate model and compute accuracy\n", + "model1.eval()\n", "y_predict = []\n", "for x, y_target in zip(X, y):\n", " output = model1(Tensor(x))\n", @@ -499,6 +500,7 @@ ], "source": [ "# Evaluate model and compute accuracy\n", + "model2.eval()\n", "y_predict = []\n", "for x in X:\n", " output = model2(Tensor(x))\n", @@ -704,6 +706,7 @@ "plt.plot(X, y, \"bo\")\n", "\n", "# Plot fitted line\n", + "model3.eval()\n", "y_ = []\n", "for x in np.linspace(lb, ub):\n", " output = model3(Tensor([x]))\n",