Writing Custom Python Layer With Learnable Parameters in Caffe

人走茶凉 提交于 2019-12-23 16:43:16

问题


I know that this example is supposed to illustrate how to add trainable parameters in a Python layer using the add_blob() method.

However, I am still unable to understand how this can be used to set the dimensions of the blob based on user defined parameters.

There is a better example here on how to write a Python layer here. But here, the layer does not contain any trainable parameters.

Please explain how to write a custom Python layer with trainable parameters.


回答1:


When you add a parameters blob using add_blob(), you can reshape the added blob, either in setup() method (right when you add it), or in the layer's reshape() method.



来源:https://stackoverflow.com/questions/39458461/writing-custom-python-layer-with-learnable-parameters-in-caffe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!