Skip to content

Commit

Permalink
Update 5_1_Least_Squares_Loss.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
udlbook authored Dec 17, 2023
1 parent c56251d commit aa04c28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Notebooks/Chap05/5_1_Least_Squares_Loss.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@
"# Hopefully, you can see that the maximum of the likelihood fn is at the same position as the minimum negative log likelihood\n",
"# The least squares solution does not depend on sigma, so it's just flat -- no use here.\n",
"# Let's check that:\n",
"print(\"Maximum likelihood = %3.3f, at beta_1=%3.3f\"%( (likelihoods[np.argmax(likelihoods)],sigma_vals[np.argmax(likelihoods)])))\n",
"print(\"Minimum negative log likelihood = %3.3f, at beta_1=%3.3f\"%( (nlls[np.argmin(nlls)],sigma_vals[np.argmin(nlls)])))\n",
"print(\"Maximum likelihood = %3.3f, at sigma=%3.3f\"%( (likelihoods[np.argmax(likelihoods)],sigma_vals[np.argmax(likelihoods)])))\n",
"print(\"Minimum negative log likelihood = %3.3f, at sigma=%3.3f\"%( (nlls[np.argmin(nlls)],sigma_vals[np.argmin(nlls)])))\n",
"# Plot the best model\n",
"sigma= sigma_vals[np.argmin(nlls)]\n",
"y_model = shallow_nn(x_model, beta_0, omega_0, beta_1, omega_1)\n",
Expand All @@ -564,4 +564,4 @@
}
}
]
}
}

0 comments on commit aa04c28

Please sign in to comment.