GithubHelp home page GithubHelp logo

yuyijie1995 / dropblock_mxnet_bottom_implemention Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 2.0 422 KB

用C++实现一个mxnet版本dropblock Op 最后可以用mx.sym.Dropblock()调用

C++ 70.43% Cuda 27.39% Python 2.18%

dropblock_mxnet_bottom_implemention's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dropblock_mxnet_bottom_implemention's Issues

Code does work on ndarray/gluon API

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)>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.