From 38064db8b3112e43e993dcc94718ea2f82063117 Mon Sep 17 00:00:00 2001 From: neingeist Date: Thu, 2 Oct 2014 22:08:08 +0200 Subject: [PATCH] Print out the cost function J --- ex1/gradientDescent.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ex1/gradientDescent.m b/ex1/gradientDescent.m index 89734f3..f01b849 100644 --- a/ex1/gradientDescent.m +++ b/ex1/gradientDescent.m @@ -18,6 +18,8 @@ for iter = 1:num_iters % theta = theta - (alpha/m) * X' * (X*theta - y); + J = computeCost(X, y, theta) + % ============================================================ % Save the cost J in every iteration