Define a specific filter to be used in convs
Hello BVLC community,
I would like to know how to modify the "learned" filters by the net. I tried to search through the cpp files to find the appropriate one but did not find any. I have my problem analyzed and have an idea to apply certain filters to hopefully improve the results of my net. I found that convoluting according to certain filter might obtain a better feature to describe my problem. Could you help me in locating were that code might be? I am a bit lost trying to search for the appropriate cpp.. I have wrote my own filter and would like to apply it to my data.
Thank you
Hi Engin007,
caffe::Net exposes layers() and layer_names() methods that you can use to find and get the layer you are looking for.
All Layer classes expose a public blobs() method (see Layer.hpp) which returns a ref to a vector of shared pointers to Blob
*(blob->mutable_cpu_data() + blob->offset(0,c,h,w)) = some float, where c is the channel, h is height, w is width.
I haven't tried most of this myself so no guarantees, but it should give you somewhere to start.
Thank you for your reply! I will give it a shot, I have overlooked the blob structure (which actually should be my starting point) . Thank you for pointing that out
Check out the editing model parameters example on the home page that shows how to assign parameters through Python and save the resulting model. In this way you can transplant your custom filters into a model.
Note that you should ask usage questions like this on the caffe-users mailing list.
I did not know where to post these issues, now I do :) thanks for the help