I made a CNN to solve a regression problem. The problem is, as I run the code, the distribution of the kernel weight do not change while the gradients of them have some value.
On the other hand, the biases' gradients and values are both changing.
This is the weights & biases distribution on the TensorBoard. The first line shows the gradients and the second line shows the values of the weight/bias.
And this is the code I used to train the network
optimizer = tf.train.AdamOptimizer(learning_rate, beta_1)
grads = optimizer.compute_gradients(total_loss) # returns grads and vars
train_op = optimizer.minimize(total_loss)
and for the histograms on the TensorBoard.
for g in grads:
tf.summary.histogram('{}'.format(g[1].name), g[1], family='weights')
if g[0] is not None:
tf.summary.histogram('{}'.format(g[1).name), g[0], family='gradients')
I think the 'weights/conv1/kernels' and 'weights/conv2/kernels' should change.
(Actually I have more than 2 layers in the network. There are 9 cnn layers and only last convolution layer's weight changes.)
Is that result natural? Or did I misuse the optimizer.compute_gradients?
