You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/01/27 08:11:49 UTC

[GitHub] [incubator-mxnet] ChaiBapchya opened a new pull request #17445: [Large Tensor] Add support to Random Sample & Pdf ops

ChaiBapchya opened a new pull request #17445: [Large Tensor] Add support to Random Sample & Pdf ops
URL: https://github.com/apache/incubator-mxnet/pull/17445
 
 
   ## Description ##
   Extend LT support to all the random family operators
   
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - [ ] Code is well-documented: 
   - [ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] modified:   src/operator/random/multisample_op.h
   - [ ] modified:   src/operator/random/pdf_op.h
   
   ## Tests ##
   
   ## PDF Ops
   ```
   >>> mx.nd.random_pdf_negative_binomial(sample=mx.nd.random_normal(shape=(1, 2**32 + 1)), k=mx.nd.random_normal(shape=(1)), p=mx.nd.random_normal(shape=(1)))
   [[ 3.6517045   0.08385151  0.33836576 ...  1.2580111   1.200235232.96391   ]]
   <NDArray 1x4294967297 @cpu(0)>
   ```
   ```
   >>> mx.nd.random_pdf_dirichlet(sample=mx.nd.random_uniform(shape=(2**32 + 1,5),low=0, high=1), alpha=mx.nd.random_uniform(shape=(5), low=0, high=1))
   [0.02400445 0.09834412 0.00485084 ... 0.00059637 0.00062773 0.00020362]
   <NDArray 4294967297 @cpu(0)>
   ```
   ```
   >>> mx.nd.random_pdf_exponential(sample=mx.nd.random_normal(shape=(1,2**32 + 1)), lam=mx.nd.random_normal(shape=(1)))
   [[0.7160165 0.8786655  1.8491699  ... 0.590301   0.19441505 0.99005574]]
   <NDArray 1x4294967297 @cpu(0)>
   ```
   ```
   >>> mx.nd.random_pdf_normal(sample=mx.nd.random_normal(shape=(1,2**32)), mu=mx.nd.random_normal(shape=(1)), sigma=mx.nd.random_normal(shape=(1)))
   [[-0.08357255 -0.7204103  -0.52567625 ... -0.03446919 -0.02720401-0.27186853]]
   <NDArray 1x4294967296 @cpu(0)>
   ```
   ```
   >>> mx.nd.random_pdf_poisson(sample=mx.nd.random_normal(shape=(1, 2**32 + 1)), lam=mx.nd.random_normal(shape=(1)))
   [[0.39283866 0.3568688  0.46852896 ... 0.1435355  0.19014826 0.1828634 ]]
   <NDArray 1x4294967297 @cpu(0)>
   ```
   ```
   >>> mx.nd.random_pdf_uniform(sample=mx.nd.random_normal(shape=(1,2**32 + 1)), low=mx.nd.random_normal(shape=(1)), high=mx.nd.random_normal(shape=(1)))
   [[-0.53082603 -0.53082603 -0.53082603 ... -0.53082603 -0.53082603-0.53082603]]
   <NDArray 1x4294967297 @cpu(0)>
   
   ```
   
   ## Sample Ops
   ```
   >>> mx.nd.sample_uniform(shape=(2**32), low=mx.nd.random_normal(shape=(1,)), high=mx.nd.random_normal(shape=(1,)))
   
   [[1.3453104  0.9783068  1.4285539  ... 2.1584532  0.990888   0.97627187]]
   <NDArray 1x4294967296 @cpu(0)>
   ```
   ```
   >>> mx.nd.sample_poisson(shape=(2**32 + 1), lam=mx.nd.random_normal(shape=(1)))
   
   [[0. 0. 0. ... 0. 0. 0.]]
   <NDArray 1x4294967297 @cpu(0)>
   ```
   ```
   >>> mx.nd.sample_normal(mu=mx.nd.random_normal(shape=(2**32 + 1)), sigma=mx.nd.random_normal(shape=(2**32 + 1)))
   
   [ 0.7192631   1.8029252  -3.1244457  ...  1.3172784  -0.44950533
     0.5782782 ]
   <NDArray 4294967297 @cpu(0)>
   ```
   ```
   >>> mx.nd.sample_exponential(shape=(1), lam=mx.nd.random_normal(shape=(2**32 + 1)))
   
   [[-2.564538 ]
    [ 1.3046274]
    [ 3.4207358]
    ...
    [ 5.2444887]
    [ 1.7304702]
    [ 1.6264884]]
   <NDArray 4294967297x1 @cpu(0)>
   ```
   ```
   >>> mx.nd.sample_negative_binomial(k=mx.nd.random_uniform(shape=(2**32), low=0, high=1), p=mx.nd.random_uniform(shape=(2**32), low=0, high=1))
   
   [ 0.  0.  0. ... 19.  1.  0.]
   <NDArray 4294967296 @cpu(0)>
   ```
   ```
   >>> mx.nd.sample_generalized_negative_binomial(alpha=mx.nd.random_uniform(shape=(2**32), low=0, high=1), mu=mx.nd.random_uniform(shape=(2**32), low=0, high=1))
   
   [0. 0. 0. ... 2. 1. 0.]
   <NDArray 4294967296 @cpu(0)>
   ```
   ```
   >>> mx.nd.sample_gamma(alpha=mx.nd.random_uniform(shape=(2**32), low=0, high=1), beta=mx.nd.random_uniform(shape=(2**32), low=0, high=1))
   
   [3.9847539e-05 9.7578183e-02 3.0167744e-04 ... 2.7813488e-03 5.8879163e-03
    3.3052340e-01]
   <NDArray 4294967296 @cpu(0)>
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] apeforest merged pull request #17445: [Large Tensor] Add support to Random Sample & Pdf ops

Posted by GitBox <gi...@apache.org>.
apeforest merged pull request #17445: [Large Tensor] Add support to Random Sample & Pdf ops
URL: https://github.com/apache/incubator-mxnet/pull/17445
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17445: [Large Tensor] Add support to Random Sample & Pdf ops

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17445: [Large Tensor] Add support to Random Sample & Pdf ops
URL: https://github.com/apache/incubator-mxnet/pull/17445#issuecomment-580484349
 
 
   Yes, already covered.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services