Community Profile

photo

Nesara S R


Last seen: circa un anno fa Attivo dal 2019

Followers: 0   Following: 0

Statistiche

Feeds

Visto da

Domanda


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)...

quasi 5 anni fa | 1 risposta | 0

1

risposta

Domanda


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...

quasi 5 anni fa | 0 risposte | 0

0

risposte