Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

ForwardDiff with function using broadcasting

$
0
0

I am trying to use ForwardDiff to check some analytic gradients for a mse loss and logistic hypothesis function. So just looking at the loss of a single data point we have

mse(x) = (1/2)*((y - logistic.(transpose(x)*w))^2)

Where x and w are dimensionally consistent arrays. When using

 ForwardDiff.gradient(mse,X)

Where w and y were globally defined and I pass in x I am getting very different values from what I had calculated for the gradients. Is this the correct use of ForwardDiff?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images