yuyijie1995 / dropblock_mxnet_bottom_implemention Goto Github PK
View Code? Open in Web Editor NEW用C++实现一个mxnet版本dropblock Op 最后可以用mx.sym.Dropblock()调用
用C++实现一个mxnet版本dropblock Op 最后可以用mx.sym.Dropblock()调用
I tested both CPU and GPU, the code doesn't work. Any thoughts on this?
In [12]: x = mx.nd.ones(shape=(1, 1, 10, 10))
In [13]: out = mx.nd.GPUDropblock(x, p = 0.2,block_size=3, mode='always')
In [14]: out
Out[14]:
[[[[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]
[1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024 1.00024
1.00024 1.00024]]]]
<NDArray 1x1x10x10 @cpu(0)>
In [15]: x = mx.nd.ones(shape=(1, 1, 10, 10), ctx=mx.gpu(0))
[19:23:20] src/base.cc:84: Upgrade advisory: this mxnet has been built against cuDNN lib version 7401, which is older than the oldest version tested by CI (7600). Set MX
NET_CUDNN_LIB_CHECKING=0 to quiet this warning.
In [16]:
In [16]: x
Out[16]:
[[[[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]]]]
<NDArray 1x1x10x10 @gpu(0)>
In [17]: out = mx.nd.GPUDropblock(x, p = 0.2,block_size=3, mode='always')
In [18]: out
Out[18]:
[[[[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]]]]
<NDArray 1x1x10x10 @gpu(0)>
In [19]: with mx.autograd.record():
...: out = mx.nd.GPUDropblock(x, p = 0.2,block_size=3, mode='always')
...:
In [20]:
In [20]: out
Out[20]:
[[[[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]]]]
<NDArray 1x1x10x10 @gpu(0)>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.