machine learning - Is there a layer in Caffe that can get an arbitrary sub block in a blob? -


is there layer in caffe can arbitrary sub block in blob?

afaik there not general slicing layer in caffe.
if want extract sub-blocks specific channels of blob, can use "slice" layer.
depending on requirements, might find "crop" layer sufficient needs.
if need more flexible access sub-blocks, might want consider using "python" layer.


an example using "crop" layer
pointed out "crop" layer expects 2 "bottom"s since second 1 used reference shape, can produce using "dummydata" layer.
suppose want select x[:,:,3:20,5:40], 17x35 crop

layer {   name: "ref_shape_17x35"   type: "dummydata"   top: "ref_shape_17x35"   dummy_data_param { shape { dim: 1 dim: 1 dim: 17 dim: 35 } } } layer {    name: "crop_x"    type: "crop"    bottom: "x"    bottom: "ref_shape_17x35"    top: "crop_x"    crop_param {      axis: 2  # not crop first 2 dimensions      offset: 3      offset: 5    }  } 

i did not try myself, should work (let me know if doesn't).


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -