Im trying to achieve a density map from network output of dimension 20x20x1x50. Here 20x20 is the output map and 50 is the batch size.
The issue is that the value of output X is equal 0.098 across each output matrix..20x20. There is no gaussian shape like density map but a flat similar valued output map 20x20x1x50. The issue is shown in the figure attached. What am i missing here? The euclidean loss for backpropagation is given as:
case {'l2loss'}
res=(c-X);
n=1;
if isempty(dzdy) %forward
Y = sum((res(:).^2))/numel(res);
else
Y_= -1.*(c-X);
Y = 2*single (Y_ * (dzdy / n) );
end
Found the solution at https://github.com/vlfeat/matconvnet/issues/313. Query conv.var(i).value to see where the value falls, and edit that layer in the conv net. In my case I had to change biases of the conv layers
net2.params(8).value= 0.01*init_bias*ones(1, 128, 'single');%'biases',
来源:https://stackoverflow.com/questions/46463853/matconvnet-output-of-deep-networks-marix-is-uniform-valued-instead-of-varying-v