Suhas Lohit
Suhas Lohit

Reputation: 171

Writing Custom Python Layer With Learnable Parameters in Caffe

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.

Upvotes: 3

Views: 751

Answers (1)

Shai
Shai

Reputation: 114796

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.

Upvotes: 0

Related Questions