From 7e264f53103489942aa21a4f797ea72b1bd83df7 Mon Sep 17 00:00:00 2001 From: udlbook <110402648+udlbook@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:38:30 -0500 Subject: [PATCH] Created using Colaboratory --- Notebooks/Chap06/6_2_Gradient_Descent.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Notebooks/Chap06/6_2_Gradient_Descent.ipynb b/Notebooks/Chap06/6_2_Gradient_Descent.ipynb index 4bdd365..f0d10d9 100644 --- a/Notebooks/Chap06/6_2_Gradient_Descent.ipynb +++ b/Notebooks/Chap06/6_2_Gradient_Descent.ipynb @@ -4,7 +4,6 @@ "metadata": { "colab": { "provenance": [], - "authorship_tag": "ABX9TyN2N4cCnlIobOZXEjcwAvZ5", "include_colab_link": true }, "kernelspec": { @@ -310,9 +309,9 @@ { "cell_type": "code", "source": [ - "def loss_function_1D(dist_prop, data, model, phi_start, gradient):\n", + "def loss_function_1D(dist_prop, data, model, phi_start, search_direction):\n", " # Return the loss after moving this far\n", - " return compute_loss(data[0,:], data[1,:], model, phi_start+ gradient * dist_prop)\n", + " return compute_loss(data[0,:], data[1,:], model, phi_start+ search_direction * dist_prop)\n", "\n", "def line_search(data, model, phi, gradient, thresh=.00001, max_dist = 0.1, max_iter = 15, verbose=False):\n", " # Initialize four points along the range we are going to search\n",