Update CM20315_Training_III.ipynb

This commit is contained in:
Pietro Monticone
2023-11-30 16:45:28 +01:00
parent 9b13823ca8
commit 193e2329f2

View File

@@ -340,7 +340,7 @@
" return compute_loss(data[0,:], data[1,:], model, phi_start+ gradient * 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 rnage we are going to search\n",
" # Initialize four points along the range we are going to search\n",
" a = 0\n",
" b = 0.33 * max_dist\n",
" c = 0.66 * max_dist\n",
@@ -371,7 +371,7 @@
" # Rule #2 If point b is less than point c then\n",
" # then point d becomes point c, and\n",
" # point b becomes 1/3 between a and new d\n",
" # point c beocome 2/3 between a and new d \n",
" # point c becomes 2/3 between a and new d \n",
" if lossb < lossc:\n",
" d = c\n",
" b = a+ (d-a)/3\n",
@@ -381,7 +381,7 @@
" # Rule #2 If point c is less than point b then\n",
" # then point a becomes point b, and\n",
" # point b becomes 1/3 between new a and d\n",
" # point c beocome 2/3 between new a and d \n",
" # point c becomes 2/3 between new a and d \n",
" a = b\n",
" b = a+ (d-a)/3\n",
" c = a+ 2*(d-a)/3\n",