Gradient checking quiz

Let J(\theta) =  \theta^3. Furthermore, let \theta = 1 and \epsilon=0.01. You use the formula

(J(\theta+\epsilon )-   J(\theta-\epsilon))/2\epsilon

to approximate the derivative. What value do you get using this approximation ?(When \theta=1,the true, exact derivative is
d/d\theta J(\theta) = 3 ).

The Octave code that I used to solve this is

((1+0.01)^3-(1-0.01)^3)/(2*0.10)

3.0001

2 Responses to Gradient checking quiz

  1. suggestion says:

    (2*0.10) it should be 2*0.01

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: