Dropblock


#1

Does mxnet have the operation of implementing dropblock?


#2

Similar to how it is implemented in TF, you can implement this in MXNet using a combination of binomial sampling and maxpool.

mask = 1 - nd.Pooling(nd.random.multinomial(nd.array([1.0-gamma, gamma]), (1, 1, h, w)).astype('float32'), kernel=(block_size, block_size), pool_type='max', pad=(block_size//2, block_size//2))

#3

Let me know if you are looking for a gluon HybridBlock implementation and I can help you with that.


#4

ok,thanks for your suggesion, I am trying to make a python layer of dropblok.


#5

What’s a python layer? Are you using Gluon API?


#6

Something like this?


#7

Are you using Gluon? if so, you shouldn’t need to write a custom op. You can instead write your own custom gluon HybridBlock. Otherwise for custom op you’d have to implement both forward() and backward() formula.