How to randomly crop data in intermediate layer?

35 views
Skip to first unread message

Parag Chandakkar

unread,
Jun 4, 2016, 7:10:39 PM6/4/16
to Caffe Users
I am trying to replicate Deep Residual Net - CIFAR10 experiments. In that, the net takes as input the zero-padded images (4 pixels zero-padded on each side) and crops a 32x32 patch at random. One easy way to achieve this would be to pad all the images in CIFAR10, convert them to LMDB format and then crop in the "DATA" layer itself. However, I am looking for another way which can achieve something as follows:

1. Get the original data.
2. Pad 4 pixels on each side (this can be easily done by using a non-learnable convolution layer with kernel size 1 and padding 4)
3. Crop a 32x32 patch randomly (I don't know how to achieve this).

A crop layer can do this but not the "random" part. It will crop from a fixed position. Any help is appreciated.
Reply all
Reply to author
Forward
0 new messages