Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating new layer in Caffe

I use caffe for my deep learning. To create a new layer for caffe, I need to

(1)add layer to proto/caffe.proto to update the next available ID

(2)make layer createable by adding it to layer_factory.cpp

My queries are what is the purpose new ID in caffe.proto and the functionality of createable in layer_factory.cpp.

There are some layers not included as createable in layer_factory.cpp. What is the difference between those layers included and not included in layer_factory.cpp.

like image 789
batuman Avatar asked Apr 18 '26 04:04

batuman


1 Answers

If you want to add a new layer to caffe, please follow the instruction in wiki/Development.
You'll see there that you don't need to change layer_factory.cpp, but rather add two macros INSTANTIATE_CLASS and REGISTER_LAYER_CLASS in your cpp file.

Regarding caffe.proto: you only need to change there if you want your layer to have a specific my_layer_param message. If your layer re-use params of existing layers, you don't need to change caffe.proto at all.

like image 65
Shai Avatar answered Apr 20 '26 09:04

Shai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!