MiniDNN icon indicating copy to clipboard operation
MiniDNN copied to clipboard

padding constructor

Open yuqi98 opened this issue 6 years ago • 2 comments

Hi! I'm trying to use MiniDNN to build CNN under C++. It seems there's no padding constructor in the configuration of convolutional layer. I was wondering if I want to add that feature, what do you recommand to do?

yuqi98 avatar Jun 25 '19 19:06 yuqi98

Unfortunately MiniDNN has not yet implemented padding types other than the "valid" rule. It is indeed some tedious work to write such low-level functions, and probably you should take a look at the tiny-dnn library, which supports different padding rules according to the documentation.

yixuan avatar Jun 28 '19 20:06 yixuan

Hi @yuqi98, Although it is not supported in MiniDNN, it can surely be done using the Eigen matrix library which it uses under the hood. A quick google search gave following ways:

https://stackoverflow.com/questions/53182368/extend-pad-matrix-in-eigen

Mind that the techniques are not optimal as a copy operation is needed. Instead I would recommend using conservativeResize as it directly manipulates the pointers of the underlying array base class. All you will need after that would be to filling the desired pad values (if not zero) using block ops.

Do let me know if you are planning to do that, we can may be collaborate.

Asheesh

Asheeshkrsharma avatar Sep 10 '19 11:09 Asheeshkrsharma