Community Profile

photo

Nesara S R


Last seen: 4 months ago Active since 2019

Statistics

Content Feed

View by

Question


To compute cost and gradient for a logistic regression problem:the function returns only zeroes even though the correct value is being computed(I know it because I executed the function body separately in command line and checked)
function [J,grad]=costFunction(theta, X, y) m = length(y); z=X*theta; h=sigmoid(z); H=h.'; h1=log(H)*(-y); h2=(log(1-H)...

2 years ago | 1 answer | 0

1

answer

Question


In the following gradient Descent code, theta values are not changing at all( but the for loop is running cz J_history is getting updated). And also even though i have given fprintf no value is being displayed:
function [theta,J_history]=gradientDescent(X, y, theta, alpha, num_iters) %GRADIENTDESCENT Performs gradient descent to learn t...

2 years ago | 0 answers | 0

0

answers