Closed 20155004 closed 8 years ago
i am 20153080
usually, we don't need to set DZDY in activation extraction case, you can just let it empty.
varargin are some additional inputs or options you want to set, such as 'conserveMemory' or 'cudnn'. It is also not usually required in activation extraction.
so. you can just use
res = vl_simplenn(net, x, [], res);
in im2descAp.m
We only need to train fully-connnected part so they are needless. You can use only
res=vl_simplenn(net,x);
Thank you. more questions
error: vl_simplenn (line 193) res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, ...
error: im2descAp (line 27) res = vl_simplenn(net, t, [], res);
In your original question,
you can use res=vl_simplenn(net, img); and then you can get activation array in res(layer_ID+1).x you don't need to define dzdy and any varagin
In your another questions,
Answer :
you can use net.normalization.averageImage at your input image. you have to convert uint8 type into single type at the input image using single function. (if you use im2single function, range of your image will be [0~1], so you have to use single function) And then, your input image have to subtract averageImage like that : img = img - net.normalization.averageImage;
thank you, Choi seok eon (20153640)
Thank you.
but, each element of net.normalization.averageImage > 100
then img = img - net.normalization.averageImage has ( - ) value.
Is it right?
Yes, that process makes image zero-mean.
So, img should have ( - ) value
yes it makes zero mean. you can get more information in this homepage
http://www.vlfeat.org/matconvnet/quick/
If you don't subtract average of image, you will get about 25% accuracy rate. But, if you subtract this, you will get 60% accuracy rate or more
Thank you Choi seok eon (20153640)
It works at first, but it doesn't work at all from next trial ^^;;;; Exactly Do you know why??
다음 사용 중 오류가 발생함: - 행렬의 차원이 일치해야 합니다.
오류 발생: im2descAp (line 23) t = img - net.normalization.averageImage;
img = single(im);
img = imresize(img,[224 224]);
Exactly, During the first process, same error appears at certain point(35%~~) and then it doesn't work at all. 다음 사용 중 오류가 발생함: - 행렬의 차원이 일치해야 합니다.
오류 발생: im2descAp (line 23) t = img - net.normalization.averageImage
The size of net.normalization.averageImage matrix is all [224 224 3].
Therefore you will resize image to [224 224 3]
If image size will be [224 224 1], you have to convert [224 224 1] size into [224 224 3] size
You have to confirm the size of every images.
Thank you Choi seok eon (20153640)
Thank you, I don't know there are gray scale image... Now it works.
I wrote some information about 8 bit jpeg image in #9
Thank you Choi seok eon (20153640)
function res = vl_simplenn(net, x, dzdy, res, varargin)
how can i define dzdy and varagin when i use vl_simplenn in im2descAp.m?