From 7111fe397a6b3c58bef4b3bf5ff28fe4a1f594e7 Mon Sep 17 00:00:00 2001 From: Ian Beauregard Date: Mon, 17 Aug 2020 09:26:01 -0400 Subject: [PATCH] Use object attribute instead of global constant --- 05_support_vector_machines.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/05_support_vector_machines.ipynb b/05_support_vector_machines.ipynb index 2fa5543..2a47f0c 100644 --- a/05_support_vector_machines.ipynb +++ b/05_support_vector_machines.ipynb @@ -1109,7 +1109,7 @@ " self.Js.append(J)\n", "\n", " w_gradient_vector = w - self.C * np.sum(X_t_sv, axis=0).reshape(-1, 1)\n", - " b_derivative = -C * np.sum(t_sv)\n", + " b_derivative = -self.C * np.sum(t_sv)\n", " \n", " w = w - self.eta(epoch) * w_gradient_vector\n", " b = b - self.eta(epoch) * b_derivative\n",