我正在使用AlexNet来训练基于回归的计数估计。 我的代码如下:
...
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') ;
但输入图像的预制对于所有图像都是不变的而且是负面的..我在这里做错了什么?