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 2018/11/24 14:50:13 UTC

[GitHub] aksnzhy opened a new pull request #13392: add csr sample op

aksnzhy opened a new pull request #13392: add csr sample op
URL: https://github.com/apache/incubator-mxnet/pull/13392
 
 
   This pr add the graph sampling op, which will be used in the DGL project.
   @zheng-da Please review this pr. Thanks!
   
   For example:
   
   ```
   shape = (5, 5)
   prob = mx.nd.array([0.9, 0.8, 0.2, 0.4, 0.1], dtype=np.float32)
   data_np = np.array([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], dtype=np.int64)
   indices_np = np.array([1,2,3,4,0,2,3,4,0,1,3,4,0,1,2,4,0,1,2,3], dtype=np.int64)
   indptr_np = np.array([0,4,8,12,16,20], dtype=np.int64)
   a = mx.nd.sparse.csr_matrix((data_np, indices_np, indptr_np), shape=shape)
   
   seed = mx.nd.array([0,1,2,3,4], dtype=np.int64)
   out = mx.nd.contrib.csr_neighbor_non_uniform_sample(a, prob, seed, num_args=3, num_hops=1, num_neighbor=2, max_num_vertices=5)
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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