Use object attribute instead of global constant

This commit is contained in:
Ian Beauregard
2020-08-17 09:26:01 -04:00
committed by GitHub
parent 1e81324573
commit 7111fe397a

View File

@@ -1109,7 +1109,7 @@
" self.Js.append(J)\n", " self.Js.append(J)\n",
"\n", "\n",
" w_gradient_vector = w - self.C * np.sum(X_t_sv, axis=0).reshape(-1, 1)\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", " \n",
" w = w - self.eta(epoch) * w_gradient_vector\n", " w = w - self.eta(epoch) * w_gradient_vector\n",
" b = b - self.eta(epoch) * b_derivative\n", " b = b - self.eta(epoch) * b_derivative\n",