Discussion:
[theano-users] theano, lasagne gradient of output node with respect to input variable giving 0
S Nothing
2018-09-19 15:32:31 UTC
Permalink
I have a binary classification neural network.

I want to compute the gradient of the score associated with a label with
respect to the input.

The following code compiles but returns 0 for the gradients on a non-zero
input.

`

conv_layer=network_dict['conv1']
conv_layer_params=lasagne.layers.get_all_params(conv_layer)
weights_conv_layer=conv_layer_params[0]
predictions=lasagne.layers.get_output(network_dict['prob'])
top_pred_label=T.argmax(predictions,axis=1)[0]
grad_label_conv=theano.grad(top_pred_label,weights_conv_layer)
get_pred_and_grad=theano.function([input_var],[grad_label_conv])

`

Any suggestions on how to debug?

Thanks.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...