0

I'm using AlexNet to train regression based count estimation. My code as as folows

...
net.addLayer('fc7', dagnn.Conv('size', [1 1 4096 4096], 'hasBias', true, 'stride', [1, 1], 'pad', [0 0 0 0]), {'bn6'}, {'fc7'},  {'conv7f'  'conv7b'});
net.addLayer('relu7', dagnn.ReLU(), {'fc7'}, {'relu7'}, {});
net.addLayer('bn7',dagnn.BatchNorm('numChannels',4096),{'relu7'},{'bn7'},{'bn7f','bn7b','bn7m'});

classLabels=max(unique(imdb_32.images.labels));
net.addLayer('classifier', dagnn.Conv('size', [1 1 4096 1], 'hasBias', true, 'stride', [1, 1], 'pad', [0 0 0 0]), {'bn7'}, {'classifier'},  {'conv8f'  'conv8b'});
 net.addLayer('prediction', dagnn.SoftMax(), {'classifier'}, {'prediction'}, {});
 net.addLayer('objective', dagnn.Loss('loss','logistic'), {'prediction', 'label'}, {'objective'}, {});
net.addLayer('error', dagnn.Loss('loss', 'classerror'), {'prediction','label'}, 'error') ;

But the preduction of input image is constant for all the images and negative.. what am I doing wrong here?

h612
  • 544
  • 2
  • 11

0 Answers0