如何编写具有可训练参数的caffe python层? [英] how to write caffe python layer with trainable parameters?
问题描述
我想学习如何编写caffe python层。
但是我只找到有关非常简单的层的示例,例如 pyloss
。
I want to learn how to write caffe python layers.
But I only find examples about very simple layers like pyloss
.
如何编写具有可训练参数的python caffe?
How to write python caffe with trainable parameters?
例如,如何编写完全连接的python层?
For example, how to write a fully connected python layer?
推荐答案
Caffe将图层的可训练参数存储为 blobs
的向量。默认情况下,此向量为空,由您决定是否在层的设置
中添加参数blob。在 test_python_layer.py
。
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
.
请参见这篇文章,以获取有关caffe中 Python
层的更多信息。
See this post for more information about "Python"
layers in caffe.
这篇关于如何编写具有可训练参数的caffe python层?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!