1
votes

I want to learn how to write caffe python layers.
But I only find examples about very simple layers like pyloss.

How to write python caffe with trainable parameters?

For example, how to write a fully connected python layer?

1
@Shai, I don't think this two are the same question. My question is how to creat a python layer with parameters, for example, how to implement a python fully connected layers? - kli_nlpr
The other question is about writing a python layer with parameters - which is exactly the title of your question. - Shai
Thank you @Shai, I will edit my question more clearly. - kli_nlpr

1 Answers

1
votes

Caffe stores the layer's trainable parameters as a vector of blobs. By default this vector is empty and it is up to you to add parameters blobs to it in the setup of the layer. There is a simple example for a layer with parameters in test_python_layer.py.

See this post for more information about "Python" layers in caffe.