machine learning - How to generate customer Pooling layer prototxt in pycaffe? -
my goal achieve pooling layer prototxt code follows:
layer { name: "my_pooling" type: "pooling_custom" bottom: "conv1" top: "my_pooling" pooling_custom_param { pool: max kernel_size: 2 stride: 2 engine : caffe } }
where pooking_custom
, pooling_custom_param
modify pooling. want use python generate above output. using netspec it:
from caffe import params p n = caffe.netspec() my_pooling = l.pooling(conv1, type="pooling_custom", pool=p.pooling.max, kernel_size=2, stride=2, engine=1)
however, cannot generate pooling_custom_param
. how can it? current result is
layer { name: "my_pooling" type: "pooling_custom" bottom: "conv1" top: "my_pooling" pooling_param { pool: max kernel_size: 2 stride: 2 engine : caffe } }
if you're doing subtype of pooling, can't: attribute names defined parent template. can change values (right side of each item, after colon).
the functional reason you're incorporating methods parent class in field names hard-coded. instance, there refers pooling_param["kernel_size"]. if have changed name pooling_custom_param, need reconfigure software ... , that's outside language's software implementation.
if really need change attribute name, you're welcome clone entire pooling class, make change, , instantiate layers of new class.
Comments
Post a Comment