I read the theano tutorial to learn theano, when I read the code of LR,

gw, gb = T.grad(cost, [w, b])

I knew this is the derivative of cost wr.t. w and b,from the matirials, if we want to obtain gw,gb,we should use the function like this,

f= function([w,b], [gw, gb])

and then use the value of w and b to compute gw, gb, like f(w,b)

But, in this code it used gw and db directly in the train function. Anyone who can explain why, thanks a lot.

asked Oct 23 '14 at 11:27

sunyanan's gravatar image

sunyanan
1111

Be the first one to answer this question!
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.