Open anselmoferreira opened 7 years ago
i think run colormap jet after vl_imarraysc just in case it is setting the colormap to something else
Thanks @omair-kg for the help. However, the problem continues even if I set colormap before vl_imarraysc.
Aren't your filters RGB? Meaning with 3 channels? In that case the colorbar is ignored...
Hi @lenck, good point. Is it possible to convert the filters to grayscale and then use a grayscale colormap? thanks.
Sure, as simple as taking average over the third dimension... mean(filters, 3)
...
Thanks again @lenck ,
The size of filters in the first layer are
>> size(squeeze(net.layers{1}.weights{1}))
ans =
5 5 3 32
If I do the following:
vl_imarraysc(mean(squeeze(net.layers{1}.weights{1}),3),'spacing',2);
The following error returns to me:
Error using vl_imarraysc (line 59)
A has more than three dimensions and the third one is not equal to three.
Error in salva_filtros (line 10)
vl_imarraysc(mean(squeeze(net.layers{1}.weights{1}),3),'spacing',2);
What I did wrong?
You just need to squeeze it and it should work then :)
Or you can update the vl_imarraysc
from my fork... Hopefully we will push this to main vlfeat repo soon...
I usually save the first layer filters in a pdf file and this works perfectly well for the MNIST network.
I can do almost the same for the CIFAR network in matconvnet using the vlfeat library. The code is below:
The result of such operation is the following image:
Pdf Image with filters
As you can see, most of colors on the left can't be found in the colorbar (or I am wrong?), for example, I can't find gray and purple in the colorbar in the right.
Is there a better way to show CIFAR first layer filters in a pdf file using colorbars?
Is it also possible to convert these filters to gray and use gray colormap?