From 6a8273459f4e23395e1b639f8f3002e3cbb2cd12 Mon Sep 17 00:00:00 2001 From: udlbook <110402648+udlbook@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:25:21 -0500 Subject: [PATCH] Created using Colab --- Notebooks/Chap09/9_1_L2_Regularization.ipynb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Notebooks/Chap09/9_1_L2_Regularization.ipynb b/Notebooks/Chap09/9_1_L2_Regularization.ipynb index 573f010..9c6e090 100644 --- a/Notebooks/Chap09/9_1_L2_Regularization.ipynb +++ b/Notebooks/Chap09/9_1_L2_Regularization.ipynb @@ -4,7 +4,6 @@ "metadata": { "colab": { "provenance": [], - "authorship_tag": "ABX9TyPJzymRTuvoWggIskM2Kamc", "include_colab_link": true }, "kernelspec": { @@ -458,14 +457,14 @@ { "cell_type": "code", "source": [ - "def dldphi0(phi, lambda_):\n", + "def dregdphi0(phi, lambda_):\n", " # TODO compute the derivative with respect to phi0\n", " # Replace this line:]\n", " deriv = 0\n", "\n", " return deriv\n", "\n", - "def dldphi1(phi, lambda_):\n", + "def dregdphi1(phi, lambda_):\n", " # TODO compute the derivative with respect to phi1\n", " # Replace this line:]\n", " deriv = 0\n", @@ -475,8 +474,8 @@ "\n", "\n", "def compute_gradient2(data_x, data_y, phi, lambda_):\n", - " dl_dphi0 = gabor_deriv_phi0(data_x, data_y, phi[0],phi[1])+dldphi0(np.squeeze(phi), lambda_)\n", - " dl_dphi1 = gabor_deriv_phi1(data_x, data_y, phi[0],phi[1])+dldphi1(np.squeeze(phi), lambda_)\n", + " dl_dphi0 = gabor_deriv_phi0(data_x, data_y, phi[0],phi[1])+dregdphi0(np.squeeze(phi), lambda_)\n", + " dl_dphi1 = gabor_deriv_phi1(data_x, data_y, phi[0],phi[1])+dregdphi1(np.squeeze(phi), lambda_)\n", " # Return the gradient\n", " return np.array([[dl_dphi0],[dl_dphi1]])\n", "\n", @@ -535,4 +534,4 @@ } } ] -} +} \ No newline at end of file