[GitHub] piiswrong commented on a change in pull request #7393: add depthwise convolution's gpu version optimization

2017-08-08 Thread git
piiswrong commented on a change in pull request #7393: add depthwise 
convolution's gpu version optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#discussion_r132094838
 
 

 ##
 File path: tests/python/unittest/test_operator.py
 ##
 @@ -955,6 +955,40 @@ def test_convolution_grouping():
 for arr1, arr2 in zip(exe1.outputs + exe1.grad_arrays, exe2.outputs + 
exe2.grad_arrays):
 np.testing.assert_allclose(arr1.asnumpy(), arr2.asnumpy(), rtol=1e-3, 
atol=1e-4)
 
+def test_depthwise_convolution():
+num_base = 32
+num_filter = num_base
+num_group = num_base
+kernel = (3, 3)
+stride = (1, 1)
+pad = (1,1)
+shape = (2, num_base, 224, 224)
+
+x = mx.sym.Variable('x')
+w = mx.sym.Variable('w')
+b = mx.sym.Variable('b')
+y1 = mx.sym.Convolution(data=x, weight=w, bias=b, num_filter=num_filter, 
num_group=num_group, kernel=kernel, stride=stride, pad=pad)
+xslice = mx.sym.SliceChannel(data=x, num_outputs=num_group, axis=1)
+wslice = mx.sym.SliceChannel(data=w, num_outputs=num_group, axis=0)
+bslice = mx.sym.SliceChannel(data=b, num_outputs=num_group, axis=0)
+y2 = mx.sym.Concat(*[mx.sym.Convolution(data=xslice[i], weight=wslice[i], 
bias=bslice[i],
+num_filter=num_filter/num_group, 
kernel=kernel, stride=stride, pad=pad)
+   for i in range(num_group)])
+
+dev = mx.gpu(0)
 
 Review comment:
   dev = default_context().
   This will fail on gpu-less test servers.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7393: add depthwise convolution's gpu version optimization

2017-08-08 Thread git
piiswrong commented on a change in pull request #7393: add depthwise 
convolution's gpu version optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#discussion_r132094170
 
 

 ##
 File path: tests/python/unittest/test_operator.py
 ##
 @@ -955,6 +955,40 @@ def test_convolution_grouping():
 for arr1, arr2 in zip(exe1.outputs + exe1.grad_arrays, exe2.outputs + 
exe2.grad_arrays):
 np.testing.assert_allclose(arr1.asnumpy(), arr2.asnumpy(), rtol=1e-3, 
atol=1e-4)
 
+def test_depthwise_convolution():
 
 Review comment:
   Please move tests to tests/python/gpu/test_operator_gpu.py and use the 
standard consistency and numerical gradient tests.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7393: add depthwise convolution's gpu version optimization

2017-08-08 Thread git
piiswrong commented on a change in pull request #7393: add depthwise 
convolution's gpu version optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#discussion_r132093497
 
 

 ##
 File path: src/operator/convolution-inl.h
 ##
 @@ -97,6 +98,8 @@ struct ConvolutionParam : public 
dmlc::Parameter {
 .set_default(dmlc::optional())
 .describe("Set layout for input, output and weight. Empty for\n"
   "default layout: NCW for 1d, NCHW for 2d and NCDHW for 3d.");
+DMLC_DECLARE_FIELD(depthwise_conv_off).set_default(false)
+.describe("whether to turn off depthwise convolution for this layer");
 
 Review comment:
   any reason we would want to turn this off?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong closed pull request #7391: Update CONTRIBUTORS.md

2017-08-08 Thread git
piiswrong closed pull request #7391: Update CONTRIBUTORS.md
URL: https://github.com/apache/incubator-mxnet/pull/7391
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] crazy-cat opened a new pull request #7393: add depthwise convolution's gpu version optimization

2017-08-08 Thread git
crazy-cat opened a new pull request #7393: add depthwise convolution's gpu 
version optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393
 
 
   
   As the cudnn is not optimized for depthwise convolution, we optimized the 
gpu version of depthwise 2D convolution. 
   The  training effect is as follows:
   **cudnn version mobilenet training in imagenet** 
   ```
   cd example/image-classification/;
   python train_imagenet.py --network mobilenet --gpus=0 
--data-train=./train_480_q95.rec --data-nthreads 8
   
   INFO:root:start with arguments Namespace(batch_size=128, benchmark=0, 
data_nthreads=8, data_train='./train_480_q95.rec', data_val=None, 
disp_batches=20, dtype='float32', gpus='0', image_shape='3,224,224', 
kv_store='device', load_epoch=None, lr=0.1, lr_factor=0.1, 
lr_step_epochs='30,60', max_random_aspect_ratio=0.25, max_random_h=36, 
max_random_l=50, max_random_rotate_angle=10, max_random_s=50, 
max_random_scale=1, max_random_shear_ratio=0.1, min_random_scale=1, 
model_prefix=None, mom=0.9, monitor=0, network='mobilenet', num_classes=1000, 
num_epochs=80, num_examples=1281167, num_layers=50, optimizer='sgd', 
pad_size=0, random_crop=1, random_mirror=1, rgb_mean='123.68,116.779,103.939', 
test_io=0, top_k=0, wd=0.0001)
   [10:03:41] src/io/iter_image_recordio_2.cc:135: ImageRecordIOParser2: 
./train_480_q95.rec, use 7 threads for decoding..
   [10:03:45] src/operator/././cudnn_algoreg-inl.h:65: Running performance 
tests to find the best convolution algorithm, this can take a while... (setting 
env variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable)
   INFO:root:Epoch[0] Batch [20]Speed: 133.85 samples/sec   
accuracy=0.000744
   INFO:root:Epoch[0] Batch [40]Speed: 135.98 samples/sec   
accuracy=0.001953
   INFO:root:Epoch[0] Batch [60]Speed: 135.47 samples/sec   
accuracy=0.000391
   INFO:root:Epoch[0] Batch [80]Speed: 132.32 samples/sec   
accuracy=0.001563
   INFO:root:Epoch[0] Batch [100]   Speed: 134.01 samples/sec   
accuracy=0.001953
   ```
   
   **our version mobilenet training in imagenet** 
   
   ```
   cd example/image-classification/;
   python train_imagenet.py --network mobilenet --gpus=0 
--data-train=./train_480_q95.rec --data-nthreads 8
   
   INFO:root:start with arguments Namespace(batch_size=128, benchmark=0, 
data_nthreads=8, data_train='./train_480_q95.rec', data_val=None, 
disp_batches=20, dtype='float32', gpus='0', image_shape='3,224,224', 
kv_store='device', load_epoch=None, lr=0.1, lr_factor=0.1, 
lr_step_epochs='30,60', max_random_aspect_ratio=0.25, max_random_h=36, 
max_random_l=50, max_random_rotate_angle=10, max_random_s=50, 
max_random_scale=1, max_random_shear_ratio=0.1, min_random_scale=1, 
model_prefix=None, mom=0.9, monitor=0, network='mobilenet', num_classes=1000, 
num_epochs=80, num_examples=1281167, num_layers=50, optimizer='sgd', 
pad_size=0, random_crop=1, random_mirror=1, rgb_mean='123.68,116.779,103.939', 
test_io=0, top_k=0, wd=0.0001)
   [09:59:19] src/io/iter_image_recordio_2.cc:135: ImageRecordIOParser2: 
./train_480_q95.rec, use 7 threads for decoding..
   [09:59:25] src/operator/././cudnn_algoreg-inl.h:65: Running performance 
tests to find the best convolution algorithm, this can take a while... (setting 
env variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable)
   INFO:root:Epoch[0] Batch [20]Speed: 476.02 samples/sec   
accuracy=0.000372
   INFO:root:Epoch[0] Batch [40]Speed: 489.77 samples/sec   
accuracy=0.001563
   INFO:root:Epoch[0] Batch [60]Speed: 495.26 samples/sec   
accuracy=0.000781
   INFO:root:Epoch[0] Batch [80]Speed: 494.94 samples/sec   
accuracy=0.001563
   INFO:root:Epoch[0] Batch [100]   Speed: 494.81 samples/sec   
accuracy=0.002734
   ```
   
   The defaule depthwise conv will go in optimized version, you can **change 
depthwise_conv_off to True  in symbols/mobilenet.py** if you want to use cudnn 
version.
   ```
   ...
   conv = mx.sym.Convolution(data=data, num_filter=num_filter, 
kernel=kernel, num_group=num_group, stride=stride, pad=pad, no_bias=True,  
depthwise_conv_off=True,
   name='%s%s_conv2d' %(name, suffix))
   ...
   ```
   **Hardware :**
   `TITAN X (Pascal) + Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz * 16 + 128GMem
   `
   **Software :**
   `cuda8.0 + cudnn5.1
   `
   As described above, we get about 3-4 times speed compared the cudnn version. 
About the test, we  have compared the result in every depthwise layer with the 
conv version.
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha closed pull request #7392: update for cudnn7 for rnn changes

2017-08-08 Thread git
szha closed pull request #7392: update for cudnn7 for rnn changes
URL: https://github.com/apache/incubator-mxnet/pull/7392
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7392: update for cudnn7 for rnn changes

2017-08-08 Thread git
szha commented on issue #7392: update for cudnn7 for rnn changes
URL: https://github.com/apache/incubator-mxnet/pull/7392#issuecomment-321150940
 
 
   #7347 already covers this
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7347: Tensorcore conv deconv support

2017-08-08 Thread git
piiswrong commented on a change in pull request #7347: Tensorcore conv deconv 
support
URL: https://github.com/apache/incubator-mxnet/pull/7347#discussion_r132088512
 
 

 ##
 File path: src/operator/cudnn_algoreg-inl.h
 ##
 @@ -40,12 +65,17 @@ class CuDNNAlgoReg {
 oss << "cudnn_data_type=" << cudnn_data_type << ";";
 oss << "cudnn_forward_compute_type=" << cudnn_forward_compute_type << ";";
 oss << "cudnn_backward_compute_type=" << cudnn_backward_compute_type << 
";";
+// A system could be heterogeneous and thus have different algo choices 
for different
+// device ids.  'device_id' could possibly be replaced with gpu compute 
capability,
+// but identical GPUs could technically have different clock settings.
+oss << "device_id=" << device_id << ";";
 
 Review comment:
   BTW have been thinking about making the key more compact. Strings can be slow
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7347: Tensorcore conv deconv support

2017-08-08 Thread git
piiswrong commented on a change in pull request #7347: Tensorcore conv deconv 
support
URL: https://github.com/apache/incubator-mxnet/pull/7347#discussion_r132088433
 
 

 ##
 File path: src/operator/cudnn_algoreg-inl.h
 ##
 @@ -40,12 +65,17 @@ class CuDNNAlgoReg {
 oss << "cudnn_data_type=" << cudnn_data_type << ";";
 oss << "cudnn_forward_compute_type=" << cudnn_forward_compute_type << ";";
 oss << "cudnn_backward_compute_type=" << cudnn_backward_compute_type << 
";";
+// A system could be heterogeneous and thus have different algo choices 
for different
+// device ids.  'device_id' could possibly be replaced with gpu compute 
capability,
+// but identical GPUs could technically have different clock settings.
+oss << "device_id=" << device_id << ";";
 
 Review comment:
   Let's ignore clock setting for now.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7347: Tensorcore conv deconv support

2017-08-08 Thread git
piiswrong commented on a change in pull request #7347: Tensorcore conv deconv 
support
URL: https://github.com/apache/incubator-mxnet/pull/7347#discussion_r132088433
 
 

 ##
 File path: src/operator/cudnn_algoreg-inl.h
 ##
 @@ -40,12 +65,17 @@ class CuDNNAlgoReg {
 oss << "cudnn_data_type=" << cudnn_data_type << ";";
 oss << "cudnn_forward_compute_type=" << cudnn_forward_compute_type << ";";
 oss << "cudnn_backward_compute_type=" << cudnn_backward_compute_type << 
";";
+// A system could be heterogeneous and thus have different algo choices 
for different
+// device ids.  'device_id' could possibly be replaced with gpu compute 
capability,
+// but identical GPUs could technically have different clock settings.
+oss << "device_id=" << device_id << ";";
 
 Review comment:
   Let's ignore clock setting for now and use compute capability
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7304: [WIP] gluon bce & ctc losses

2017-08-08 Thread git
szha commented on issue #7304: [WIP] gluon bce & ctc losses
URL: https://github.com/apache/incubator-mxnet/pull/7304#issuecomment-321144365
 
 
   Updating the interface now for potential integration with cudnn7. Do not 
merge yet.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha opened a new pull request #7392: update for cudnn7 for rnn changes

2017-08-08 Thread git
szha opened a new pull request #7392: update for cudnn7 for rnn changes
URL: https://github.com/apache/incubator-mxnet/pull/7392
 
 
   This is to reflect a change in `cudnnSetRNNDescriptor` in cudnn 7, and 
should enable building with cudnn7.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nikrao commented on issue #7390: adding ranking metrics (precision/recall) at position K.

2017-08-08 Thread git
nikrao commented on issue #7390: adding ranking metrics (precision/recall) at 
position K. 
URL: https://github.com/apache/incubator-mxnet/pull/7390#issuecomment-321143824
 
 
   fixed. pylint checks pass now. 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7390: adding ranking metrics (precision/recall) at position K.

2017-08-08 Thread git
eric-haibin-lin commented on a change in pull request #7390: adding ranking 
metrics (precision/recall) at position K. 
URL: https://github.com/apache/incubator-mxnet/pull/7390#discussion_r132081575
 
 

 ##
 File path: python/mxnet/ranking_metrics.py
 ##
 @@ -0,0 +1,45 @@
+"""
+A function that implements ranking metrics 
+(precision, recall, coverage and converted coverage) 
+for a given position K
+"""
+
+def metrics_at_k(Y,Yhat, K):
+   """
+   Parameters
+   --
+   Y   : dictionary with key = sample index and value = list of 
positive indices of features
+   Yhat: dict wit key = sample index and value = ORDERED list of indices 
of features, according to some score
+   K   : position at which to compute score
+   
+   Returns
+   ---
+   pre : precision at K
+   rec : recall at K
+   convcoverage: converted coverage at K
+   coverage: coverage at K
+
+   Examples
+
 
 Review comment:
   Thanks for contributing back! Could you fix pylint warnings? 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] kkk669 opened a new pull request #7391: Update CONTRIBUTORS.md

2017-08-08 Thread git
kkk669 opened a new pull request #7391: Update CONTRIBUTORS.md
URL: https://github.com/apache/incubator-mxnet/pull/7391
 
 
   Because my patches have been merged in #6908 and #6927.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhreshold commented on issue #7376: MXbox -- a simple and flexible vision toolbox for mxnet framework.

2017-08-08 Thread git
zhreshold commented on issue #7376: MXbox -- a simple and flexible vision 
toolbox for mxnet framework.
URL: 
https://github.com/apache/incubator-mxnet/issues/7376#issuecomment-321130007
 
 
   Good intuition and hitting the point, but seems like there's a lot of 
duplicated function with gluon data 
loader(https://github.com/apache/incubator-mxnet/tree/master/python/mxnet/gluon/data)
 and mx.image functions(http://mxnet.io/api/python/image.html).
   
   I agree with @piiswrong  @szha to merge in, otherwise we will have to 
maintain a bunch of duplicated stuffs, which is a nightmare.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] LakeCarrot commented on issue #5837: Error caused by two different dependencies in protobuf version when using both distributed mode and tensorboard

2017-08-08 Thread git
LakeCarrot commented on issue #5837: Error caused by two different dependencies 
in protobuf version when using both distributed mode and tensorboard
URL: 
https://github.com/apache/incubator-mxnet/issues/5837#issuecomment-321120862
 
 
   I met the same problem, MXNet v0.10.0-support and Ubuntu 14.04 with GPU, S3 
and distributed training support.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7381: fix [#7368] Caffe converter test fails, causing CI to halt for all PRs

2017-08-08 Thread git
szha commented on issue #7381: fix [#7368] Caffe converter test fails, causing 
CI to halt for all PRs 
URL: https://github.com/apache/incubator-mxnet/pull/7381#issuecomment-321121243
 
 
   Thanks, @joey2014. Please revert the removed test cases.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] LakeCarrot commented on issue #5837: Error caused by two different dependencies in protobuf version when using both distributed mode and tensorboard

2017-08-08 Thread git
LakeCarrot commented on issue #5837: Error caused by two different dependencies 
in protobuf version when using both distributed mode and tensorboard
URL: 
https://github.com/apache/incubator-mxnet/issues/5837#issuecomment-321120862
 
 
   I met the same problem, with MXNet v0.10.0-support and Ubuntu 14.04 with 
GPU, S3 and distributed training support.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] joey2014 commented on issue #7381: fix [#7368] Caffe converter test fails, causing CI to halt for all PRs

2017-08-08 Thread git
joey2014 commented on issue #7381: fix [#7368] Caffe converter test fails, 
causing CI to halt for all PRs 
URL: https://github.com/apache/incubator-mxnet/pull/7381#issuecomment-321120896
 
 
   Yes, I have test it locally. The fix works 
   INFO:root:test performance of model: vgg-16
   INFO:root:./model/vgg-16_deploy.prototxt exists, skip to downloada
   INFO:root:./model/vgg-16.caffemodel exists, skip to downloada
   INFO:root:Saved checkpoint to "./model/vgg-16-.params"
   INFO:root:speed : 145.695274 image/sec
   INFO:root:('accuracy', 0.72265625)
   INFO:root:('top_k_accuracy_5', 0.8984375)
   INFO:root:test performance of model: resnet-50
   INFO:root:./model/resnet-50_deploy.prototxt exists, skip to downloada
   INFO:root:./model/resnet-50.caffemodel exists, skip to downloada
   INFO:root:./model/resnet-50_mean.binaryproto exists, skip to downloada
   INFO:root:Saved checkpoint to "./model/resnet-50-.params"
   INFO:root:speed : 258.344333 image/sec
   INFO:root:('accuracy', 0.75390625)
   INFO:root:('top_k_accuracy_5', 0.92578125)
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] LakeCarrot commented on issue #5837: Error caused by two different dependencies in protobuf version when using both distributed mode and tensorboard

2017-08-08 Thread git
LakeCarrot commented on issue #5837: Error caused by two different dependencies 
in protobuf version when using both distributed mode and tensorboard
URL: 
https://github.com/apache/incubator-mxnet/issues/5837#issuecomment-321120862
 
 
   I met the same problem, with MXNet v0.10.0support and Ubuntu 14.04 with GPU, 
S3 and distributed training support.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] qingzhouzhen closed issue #7386: How could I define function for GPU only?

2017-08-08 Thread git
qingzhouzhen closed issue #7386: How could I define function for GPU only?
URL: https://github.com/apache/incubator-mxnet/issues/7386
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: Clarify definition of cross-entropy metric in the documentation (clean up PR #7291) (#7365)

2017-08-08 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 44c2bfe  Clarify definition of cross-entropy metric in the 
documentation (clean up PR #7291) (#7365)
44c2bfe is described below

commit 44c2bfe6133ae51cfb0531600ccd6408654434e6
Author: Hessel Tuinhof 
AuthorDate: Wed Aug 9 02:25:48 2017 +0200

Clarify definition of cross-entropy metric in the documentation (clean up 
PR #7291) (#7365)

* [R] switch order of LRN and pooling layer

Original paper (section 3.5) performs local response normalization of relu.

* clearify definition of cross entropy

* fix small type

* fixed lint, trailing wspace
---
 python/mxnet/metric.py | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/python/mxnet/metric.py b/python/mxnet/metric.py
index 1a8e67d..00cc2da 100644
--- a/python/mxnet/metric.py
+++ b/python/mxnet/metric.py
@@ -854,10 +854,14 @@ class RMSE(EvalMetric):
 class CrossEntropy(EvalMetric):
 """Computes Cross Entropy loss.
 
-The cross entropy is given by
+The cross entropy over a batch of sample size :math:`N` is given by
 
 .. math::
--y\\log \\hat{y} + (1-y)\\log (1-\\hat{y})
+   -\\sum_{n=1}^{N}\\sum_{k=1}^{K}t_{nk}\\log (y_{nk}),
+
+where :math:`t_{nk}=1` if and only if sample :math:`n` belongs to class 
:math:`k`.
+:math:`y_{nk}` denotes the probability of sample :math:`n` belonging to
+class :math:`k`.
 
 Parameters
 --

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[GitHub] piiswrong closed pull request #7365: Clarify definition of cross-entropy metric in the documentation (clean up PR #7291)

2017-08-08 Thread git
piiswrong closed pull request #7365: Clarify definition of cross-entropy metric 
in the documentation (clean up PR #7291)
URL: https://github.com/apache/incubator-mxnet/pull/7365
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] joey2014 commented on a change in pull request #7381: fix [#7368] Caffe converter test fails, causing CI to halt for all PRs

2017-08-08 Thread git
joey2014 commented on a change in pull request #7381: fix [#7368] Caffe 
converter test fails, causing CI to halt for all PRs 
URL: https://github.com/apache/incubator-mxnet/pull/7381#discussion_r132065167
 
 

 ##
 File path: tools/caffe_converter/convert_symbol.py
 ##
 @@ -128,6 +128,16 @@ def _parse_proto(prototxt_fname):
 param_string = ''
 skip_layer = False
 name = re.sub('[-/]', '_', layer.name)
+for k in range(len(layer.bottom)):
 
 Review comment:
   @piiswrong 
   as comment on #7368 
   The layer input name in some cases is changed which causes the layer added 
to group by mistake, for example, in vgg16, the layer fc6 input name pool5 is 
changed to flatten_0. Moving the state recording code to the begin of the 
function can fix the issue. 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong closed pull request #7379: Add license header

2017-08-08 Thread git
piiswrong closed pull request #7379: Add license header
URL: https://github.com/apache/incubator-mxnet/pull/7379
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7264: gluon conv rnns

2017-08-08 Thread git
szha commented on issue #7264: gluon conv rnns
URL: https://github.com/apache/incubator-mxnet/pull/7264#issuecomment-321104507
 
 
   @ykim362 I tried adding dim=5 extension in MKL but didn't get it to work. 
For now I will use 1D conv as test.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing commented on issue #7375: Can I set instance weight when training?

2017-08-08 Thread git
thirdwing commented on issue #7375: Can I set instance weight when training?
URL: 
https://github.com/apache/incubator-mxnet/issues/7375#issuecomment-321101775
 
 
   @regzhuce The output of Makeloss is the gradient. See 
https://github.com/apache/incubator-mxnet/blob/master/src/operator/make_loss.cc#L35
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ZihengJiang commented on issue #7319: [RoadMap] Legacy issue resolution before 1.0 release

2017-08-08 Thread git
ZihengJiang commented on issue #7319: [RoadMap] Legacy issue resolution before 
1.0 release
URL: 
https://github.com/apache/incubator-mxnet/issues/7319#issuecomment-321099604
 
 
   Should enable multiple times resource requests
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong closed pull request #7388: Update conv_layers.py

2017-08-08 Thread git
piiswrong closed pull request #7388: Update conv_layers.py
URL: https://github.com/apache/incubator-mxnet/pull/7388
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: Update conv_layers.py (#7388)

2017-08-08 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 4c13b96  Update conv_layers.py (#7388)
4c13b96 is described below

commit 4c13b96b9ae73ac2809339798a923d2270c54f16
Author: Eric Junyuan Xie 
AuthorDate: Tue Aug 8 15:20:20 2017 -0700

Update conv_layers.py (#7388)

* Update conv_layers.py

* Update conv_layers.py
---
 python/mxnet/gluon/nn/conv_layers.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/mxnet/gluon/nn/conv_layers.py 
b/python/mxnet/gluon/nn/conv_layers.py
index d9608a1..9094edd 100644
--- a/python/mxnet/gluon/nn/conv_layers.py
+++ b/python/mxnet/gluon/nn/conv_layers.py
@@ -65,7 +65,7 @@ class _Conv(HybridBlock):
 def __init__(self, channels, kernel_size, strides, padding, dilation,
  groups, layout, in_channels=0, activation=None, use_bias=True,
  weight_initializer=None, bias_initializer='zeros',
- op_name='Convolution', prefix=None, params=None, **kwargs):
+ op_name='Convolution', adj=None, prefix=None, params=None):
 super(_Conv, self).__init__(prefix=prefix, params=params)
 with self.name_scope():
 self._channels = channels
@@ -81,7 +81,8 @@ class _Conv(HybridBlock):
 'kernel': kernel_size, 'stride': strides, 'dilate': dilation,
 'pad': padding, 'num_filter': channels, 'num_group': groups,
 'no_bias': not use_bias, 'layout': layout}
-self._kwargs.update(kwargs)
+if adj is not None:
+self._kwargs['adj'] = adj
 
 dshape = [0]*(len(kernel_size) + 2)
 dshape[layout.find('N')] = 1

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[incubator-mxnet] branch master updated: decouple record/train and add state readers (#7356)

2017-08-08 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 07661ae  decouple record/train and add state readers (#7356)
07661ae is described below

commit 07661ae9a627d2a90b15c04b665fdb0773920285
Author: Sheng Zha 
AuthorDate: Tue Aug 8 15:13:29 2017 -0700

decouple record/train and add state readers (#7356)

* decouple record/train and add state readers

* update per comments

* update per concensus

* add API doc

* fix
---
 docs/api/python/autograd.md|  21 +++--
 include/mxnet/c_api.h  |  12 +++
 python/mxnet/autograd.py   | 136 -
 python/mxnet/ndarray.py|   7 +-
 src/c_api/c_api_ndarray.cc |  12 +++
 tests/python/unittest/test_autograd.py |  37 -
 6 files changed, 174 insertions(+), 51 deletions(-)

diff --git a/docs/api/python/autograd.md b/docs/api/python/autograd.md
index 440a1e4..d204a2c 100644
--- a/docs/api/python/autograd.md
+++ b/docs/api/python/autograd.md
@@ -14,19 +14,28 @@
 ## Autograd
 
 ```eval_rst
-.. currentmodule:: mxnet.autograd
-```
-
-
-```eval_rst
 .. autosummary::
 :nosignatures:
 
 record
 pause
-mark_variables
+train_mode
+predict_mode
 backward
 set_training
+is_training
 set_recording
+is_recording
+mark_variables
+```
+
+## API Reference
+
+
+
+```eval_rst
+.. automodule:: mxnet.autograd
+:members:
 ```
 
+auto_index("api-reference");
diff --git a/include/mxnet/c_api.h b/include/mxnet/c_api.h
index d9a5315..3b8d54c 100644
--- a/include/mxnet/c_api.h
+++ b/include/mxnet/c_api.h
@@ -566,6 +566,18 @@ MXNET_DLL int MXAutogradSetIsRecording(int is_recording, 
int* prev);
  */
 MXNET_DLL int MXAutogradSetIsTraining(int is_training, int* prev);
 /*!
+ * \brief get whether autograd recording is on
+ * \param curr returns the current status.
+ * \return 0 when success, -1 when failure happens
+ */
+MXNET_DLL int MXAutogradIsRecording(bool* curr);
+/*!
+ * \brief get whether training mode is on
+ * \param curr returns the current status.
+ * \return 0 when success, -1 when failure happens
+ */
+MXNET_DLL int MXAutogradIsTraining(bool* curr);
+/*!
  * \brief mark NDArrays as variables to compute gradient for autograd
  * \param num_var number of variable NDArrays
  * \param var_handles variable NDArrays
diff --git a/python/mxnet/autograd.py b/python/mxnet/autograd.py
index 2f33052..2c3feab 100644
--- a/python/mxnet/autograd.py
+++ b/python/mxnet/autograd.py
@@ -10,7 +10,7 @@ from .ndarray import NDArray
 from .symbol import _GRAD_REQ_MAP
 
 
-def set_recording(is_recording):
+def set_recording(is_recording): #pylint: disable=redefined-outer-name
 """Set status to recording/not recording. When recording, graph will be 
constructed
 for gradient computation.
 
@@ -27,14 +27,14 @@ def set_recording(is_recording):
 ctypes.c_int(is_recording), ctypes.byref(prev)))
 return bool(prev.value)
 
-def set_training(is_train):
-"""Set status to training/not training. This affects ctx.is_train in 
operator
+def set_training(train_mode): #pylint: disable=redefined-outer-name
+"""Set status to training/predicting. This affects ctx.is_train in operator
 running context. For example, Dropout will drop inputs randomly when
-is_train=True while simply passing through if is_train=False.
+train_mode=True while simply passing through if train_mode=False.
 
 Parameters
 --
-is_train: bool
+train_mode: bool
 
 Returns
 ---
@@ -42,43 +42,70 @@ def set_training(is_train):
 """
 prev = ctypes.c_int()
 check_call(_LIB.MXAutogradSetIsTraining(
-ctypes.c_int(is_train), ctypes.byref(prev)))
+ctypes.c_int(train_mode), ctypes.byref(prev)))
 return bool(prev.value)
 
+def is_recording():
+"""Get status on recording/not recording.
 
-class RecordingStateScope(object):
+Returns
+---
+Current state of recording.
+"""
+curr = ctypes.c_bool()
+check_call(_LIB.MXAutogradIsRecording(ctypes.byref(curr)))
+return curr.value
+
+def is_training():
+"""Get status on training/predicting.
+
+Returns
+---
+Current state of training/predicting.
+"""
+curr = ctypes.c_bool()
+check_call(_LIB.MXAutogradIsTraining(ctypes.byref(curr)))
+return curr.value
+
+
+class _RecordingStateScope(object):
 """Scope for managing training state.
 
 Example::
-with RecordingStateScope(True, True):
+
+with _RecordingStateScope(True, True):
 y = model(x)
 backward([y])
+
 """
-def __init__(self, enter_state, is_train):
-self._enter_state = enter_state
-self._enter_is_train = is_train

[GitHub] eric-haibin-lin commented on issue #7082: Sparse Tensor: request for reviews

2017-08-08 Thread git
eric-haibin-lin commented on issue #7082: Sparse Tensor: request for reviews
URL: https://github.com/apache/incubator-mxnet/pull/7082#issuecomment-321096175
 
 
   Hi everyone,
   
   I've updated the branch to include code changes to address comments from 
reviewers (except the discussion re: taco's more general storage format). 
   
   Recent changes also include:
   - added sparse ndarray classes to python api markdown
   - added support storage fallback with mutable inputs 
   - updated documents for sparse ndarray classes 
   - removed todense(), to_rsp(), to_csr() and replaced with tostype()
   - changed executor debug str from macro to env var
   
   Known issues to fix include:
   - storage fallback fails on batch norm operator 
https://github.com/apache/incubator-mxnet/issues/7346
   
   I should acknowledge that this PR contains code from @reminisce(sparse dot, 
sparse retain, cast_storage, sparse elemwise sum, ndarray and infer_storage 
refactor and many other things) and @stefanhenneking (many optimized kernels 
for gpu sparse dot and cast_storage operator). This project won't go this far 
without their significant effort. 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nikrao opened a new pull request #7390: adding ranking metrics (precision/recall) at position K.

2017-08-08 Thread git
nikrao opened a new pull request #7390: adding ranking metrics 
(precision/recall) at position K. 
URL: https://github.com/apache/incubator-mxnet/pull/7390
 
 
   The file takes in data in dictionary format, for both predictions and ground 
truth. 
   
   Ranking problems are very common in several areas of ML, and specifically 
computing metrics at a certain position is common in many applications. Usually 
for recommender systems, we don't want to compute the overall precision, but 
only, say precision@10, because only 10 items might be shown to the user. It 
makes sense to optimize your model that gets the top entries right, sacrificing 
overall precision. Similar arguments hold for recall, coverage etc. Having such 
a standard metric available in MXNet will let more people in the ML community 
make use of it, and increase it's adoptation. 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] lxn2 commented on issue #7379: Add license header

2017-08-08 Thread git
lxn2 commented on issue #7379: Add license header
URL: https://github.com/apache/incubator-mxnet/pull/7379#issuecomment-321092807
 
 
   Can we merge?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7264: gluon conv rnns

2017-08-08 Thread git
szha commented on issue #7264: gluon conv rnns
URL: https://github.com/apache/incubator-mxnet/pull/7264#issuecomment-321091550
 
 
   @ykim362 looks like a problem in MKL concat. The following code causes the 
same error when using MKL version to do 5 dim concat
   ```
   mx.nd.concat(*[mx.nd.ones((1,1,1,1,1)), mx.nd.ones((1,1,1,1,1))], dim=1)
   ```
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-08 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132040459
 
 

 ##
 File path: src/operator/tensor/dot-inl.cuh
 ##
 @@ -353,27 +640,308 @@ inline void DotCsrDnsDnsImpl(mshadow::Stream* s,
 }
 
 /*!
- * \brief Impl of dot(csr.T, dns) = rsp
+ * \brief GPU Impl of dot(csr, dns) = rsp and dot(csr.T, dns) = rsp
  */
-inline void DotCsrDnsRspImpl(mshadow::Stream* s,
+inline void DotCsrDnsRspImpl(const OpContext& ctx,
+ const gpu& gpu_dev,
  const NDArray& lhs,
  const TBlob& rhs,
  const OpReqType req,
  const bool trans_lhs,
  NDArray* ret) {
-  LOG(FATAL) << "DotCsrDnsRspImpl gpu version is not implemented.";
+  if (kNullOp == req) return;
+  CHECK_EQ(lhs.storage_type(), kCSRStorage);
+  CHECK_EQ(ret->storage_type(), kRowSparseStorage);
+  if (!lhs.storage_initialized()) return;
+
+  using mshadow::Shape1;
+  using mxnet_op::Kernel;
+  using mxnet_op::set_zero;
+  using nnvm::dim_t;
+  mshadow::Stream* s = ctx.get_stream();
+
+  const TBlob data_l = lhs.data();
+  const TBlob indptr_l = lhs.aux_data(csr::kIndPtr);
+  const TBlob col_idx_l = lhs.aux_data(csr::kIdx);
+  const TBlob& data_r = rhs;
+
+  const dim_t num_rows_l = lhs.shape()[0];
+  const dim_t num_cols_l = lhs.shape()[1];
+  const dim_t num_cols_r = rhs.shape_[1];
+  const dim_t threads_per_warp = mxnet_op::cuda_get_device_prop().warpSize;
+  dim_t num_threads;
+  // TODO: remove kernel dependency on warpSize=32
+  if (threads_per_warp != 32) {
+LOG(FATAL) << "DotCsrDnsRspImpl GPU kernels expect warpSize=32";
+  }
+
+  MSHADOW_SGL_DBL_TYPE_SWITCH(data_l.type_flag_, DType, {  // data type
+MSHADOW_IDX_TYPE_SWITCH(indptr_l.type_flag_, IType, {  // indptr type
+  MSHADOW_IDX_TYPE_SWITCH(col_idx_l.type_flag_, CType, {  // col idx type
+if (trans_lhs) {
+  // Compute number of non-zero rows (nnr) of output matrix
+  // - alloc temp storage for row_flg array and for cub's prefix sum
+  // - mark non-zero columns of csr matrix in row_flg
+  // - compute inclusive prefix sum over marked array
+  // - copy last value (nnr_out) from device to host
+  dim_t* row_flg_out = NULL;
+  void* d_temp_storage = NULL;
+  size_t temp_storage_bytes = 0;
+  cub::DeviceScan::InclusiveSum(d_temp_storage,
+temp_storage_bytes,
+row_flg_out,
+row_flg_out,
+num_cols_l,
+mshadow::Stream::GetStream(s));
+  mshadow::Tensor workspace = ctx.requested[0]
+  .get_space_typed(Shape1(num_cols_l*sizeof(dim_t)+temp_storage_bytes), s);
+  row_flg_out = reinterpret_cast(workspace.dptr_);
+  d_temp_storage = workspace.dptr_ + num_cols_l*sizeof(dim_t);
+  num_threads = num_cols_l;
+  Kernel::Launch(s, num_threads, row_flg_out);
+  num_threads = num_rows_l * threads_per_warp;
+  Kernel::Launch(s, num_threads,
+  row_flg_out, col_idx_l.dptr(), indptr_l.dptr(),
+  num_rows_l, num_cols_l);
+  cub::DeviceScan::InclusiveSum(d_temp_storage,
+temp_storage_bytes,
+row_flg_out,
+row_flg_out,
+num_cols_l,
+mshadow::Stream::GetStream(s));
+  dim_t nnr_out = 0;
+  CUDA_CALL(cudaMemcpy(_out, _flg_out[num_cols_l-1], 
sizeof(dim_t),
+   cudaMemcpyDeviceToHost));
+
+  // Allocate output matrix space
+  ret->CheckAndAlloc({Shape1(nnr_out)});
+  const TBlob data_out_blob = ret->data();
+  const TBlob row_idx_out_blob = ret->aux_data(rowsparse::kIdx);
+  MSHADOW_IDX_TYPE_SWITCH(row_idx_out_blob.type_flag_, RType, {  // 
row idx type
+DType* data_out = data_out_blob.dptr();
+RType* row_idx_out = row_idx_out_blob.dptr();
+if (kWriteTo == req) {
+  num_threads = nnr_out * num_cols_r;
+  Kernel::Launch(s, num_threads, data_out);
+}
+num_threads = nnr_out;
+Kernel::Launch(s, num_threads, row_idx_out);
+
+// Fill row_idx array of output matrix, using the row_flg values
+num_threads = num_cols_l;
+Kernel::Launch(s, num_threads,
+row_idx_out, row_flg_out, num_cols_l);
+
+   

[GitHub] thirdwing opened a new pull request #7389: [R] im2rec in R. close #7273

2017-08-08 Thread git
thirdwing opened a new pull request #7389: [R] im2rec in R. close #7273
URL: https://github.com/apache/incubator-mxnet/pull/7389
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] eric-haibin-lin closed pull request #7015: RowSparse pull/push

2017-08-08 Thread git
eric-haibin-lin closed pull request #7015: RowSparse pull/push
URL: https://github.com/apache/incubator-mxnet/pull/7015
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ptrendx commented on issue #7319: [RoadMap] Legacy issue resolution before 1.0 release

2017-08-08 Thread git
ptrendx commented on issue #7319: [RoadMap] Legacy issue resolution before 1.0 
release
URL: 
https://github.com/apache/incubator-mxnet/issues/7319#issuecomment-321081480
 
 
   For me the biggest feature mxnet lacks is consistent and full documentation 
and tutorials. Gluon tutorial seems to be pretty awesome (although still 
incomplete), but the rest of the API does not have such good treatment. It got 
even worse once you removed most examples from the website (even though I agree 
that they were not well explained). 
   From the technical and performance point of view MXNet is a great (and 
probably the best actually) but it's hard to take off when others have lower 
barrier of entry and spend a lot on PR.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7376: MXbox -- a simple and flexible vision toolbox for mxnet framework.

2017-08-08 Thread git
szha commented on issue #7376: MXbox -- a simple and flexible vision toolbox 
for mxnet framework.
URL: 
https://github.com/apache/incubator-mxnet/issues/7376#issuecomment-321074332
 
 
   @Lyken17 nice! It's great to see the contribution. I'd make similar 
suggestion as Eric for the following reasons.
   
   Since Gluon will be the place where most of the development will happen 
going forward, tools in Gluon will have the most exposure as well as most 
support. Also, Gluon abstracts away NDArray and Symbol wherever possible, which 
means that tools that conform to the standard will be usable in both NDArray 
and Symbol, thus benefiting all use cases. Having it as standalone means that 
someone has to merge it to master from time to time, and it can mean more 
time-consuming process (at least 2 PRs in two places to get a bug fixed and to 
have users pick it up). Given that your time commitment is limited, I think 
merging it into Gluon will be the best option to ensure continued maintenance.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Lyken17 commented on issue #7376: MXbox -- a simple and flexible vision toolbox for mxnet framework.

2017-08-08 Thread git
Lyken17 commented on issue #7376: MXbox -- a simple and flexible vision toolbox 
for mxnet framework.
URL: 
https://github.com/apache/incubator-mxnet/issues/7376#issuecomment-321065474
 
 
   I am going to apply for graduate schools this fall, so the time I can spend 
on mxbox will be very limited. I think moving mxbox to community would be a 
good idea. And also, as for pretrained models, I do need help from community. 
   
   But I am thinking, is it better to merge mxbox into gluon.data or keep it as 
a standalone tools, like the ps-lite and tensorboard in dmlc. Since it is not 
strictly binded with gluon/ndarray, keeping it standalone can make iterations 
of develop faster (without changes to mxnet main branch).
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7377: gluon.nn.Conv2D initialization int stride not handled correctly

2017-08-08 Thread git
szha commented on issue #7377: gluon.nn.Conv2D initialization int stride not 
handled correctly
URL: 
https://github.com/apache/incubator-mxnet/issues/7377#issuecomment-321064464
 
 
   Yes, this will be fixed by #7388 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch piiswrong-patch-4 updated (11aefbb -> 6821630)

2017-08-08 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a change to branch piiswrong-patch-4
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git.


from 11aefbb  Update conv_layers.py
 add 6821630  Update conv_layers.py

No new revisions were added by this update.

Summary of changes:
 python/mxnet/gluon/nn/conv_layers.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[GitHub] kurt-o-sys commented on issue #7349: time series delay output mxnet

2017-08-08 Thread git
kurt-o-sys commented on issue #7349: time series delay output mxnet
URL: 
https://github.com/apache/incubator-mxnet/issues/7349#issuecomment-321056587
 
 
   Thx for you answer... It is a one-to-one RNN indeed, unfolded, I'd like to 
have a 'many-to-one'. Every time frame, a 'summary' of the events are added to 
the AI system. Here's how the network (more or less) looks like. 
   
   
![image](https://user-images.githubusercontent.com/2430465/29090285-50aea288-7c7f-11e7-8efa-126e545ac861.png)
   
   If I would unfold it, in the scenario described above, I'd have 51 times the 
same structure next to each. I would like to have only 1 output (the last one) 
during training. Setting to 0 is not really an option, since this would 
intervene with the training: a value of 0 is not the same as something that has 
more a meaning as 'not available yet'. 
   (During usage of the trained network, the errors made during the first 
outcomes are less important. It's just that at the start of the 'game', one 
just knows that the game state is still unsure. Only after a number of 
iterations, this improves towards how the game actually evolves).
   
   I still wonder how to achieve it, or stated another way, how I can 'remove 
the first x elements of the sequence_length' in a one-to-one RNN.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhanghang1989 closed issue #7377: gluon.nn.Conv2D initialization int stride not handled correctly

2017-08-08 Thread git
zhanghang1989 closed issue #7377: gluon.nn.Conv2D initialization int stride not 
handled correctly
URL: https://github.com/apache/incubator-mxnet/issues/7377
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong opened a new pull request #7388: Update conv_layers.py

2017-08-08 Thread git
piiswrong opened a new pull request #7388: Update conv_layers.py
URL: https://github.com/apache/incubator-mxnet/pull/7388
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rahul003 commented on a change in pull request #7321: fixes broken compilation by including tensor_blob

2017-08-08 Thread git
rahul003 commented on a change in pull request #7321: fixes broken compilation 
by including tensor_blob
URL: https://github.com/apache/incubator-mxnet/pull/7321#discussion_r131995423
 
 

 ##
 File path: src/io/inst_vector.h
 ##
 @@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 
 Review comment:
   @piiswrong Did you also mean the same thing? Changing that line to 
mxnet/tensor_blob.h doesn't compile as well.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7382: GRU not working with layout 'NTC'

2017-08-08 Thread git
szha commented on issue #7382: GRU not working with layout 'NTC'
URL: 
https://github.com/apache/incubator-mxnet/issues/7382#issuecomment-321041727
 
 
   Should already be fixed by #7385 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhanghang1989 commented on issue #7377: gluon.nn.Conv2D initialization int stride not handled correctly

2017-08-08 Thread git
zhanghang1989 commented on issue #7377: gluon.nn.Conv2D initialization int 
stride not handled correctly
URL: 
https://github.com/apache/incubator-mxnet/issues/7377#issuecomment-321041311
 
 
   ```python
   import mxnet as mx   
   from mxnet import gluon
   from mxnet.gluon import nn
   layer=nn.Conv2D(in_channels=3,   
  channels=3,  
  kernel_size=1, stride=1)
   layer.initialize() 
   x=mx.nd.random_normal(loc=0, scale=1, shape=(2, 3, 224, 224))
   layer(x) 
   ```
   will produce the Error ``Floating point exception``
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-08 Thread git
eric-haibin-lin commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r131993234
 
 

 ##
 File path: src/operator/tensor/dot-inl.cuh
 ##
 @@ -353,27 +640,308 @@ inline void DotCsrDnsDnsImpl(mshadow::Stream* s,
 }
 
 /*!
- * \brief Impl of dot(csr.T, dns) = rsp
+ * \brief GPU Impl of dot(csr, dns) = rsp and dot(csr.T, dns) = rsp
  */
-inline void DotCsrDnsRspImpl(mshadow::Stream* s,
+inline void DotCsrDnsRspImpl(const OpContext& ctx,
+ const gpu& gpu_dev,
  const NDArray& lhs,
  const TBlob& rhs,
  const OpReqType req,
  const bool trans_lhs,
  NDArray* ret) {
-  LOG(FATAL) << "DotCsrDnsRspImpl gpu version is not implemented.";
+  if (kNullOp == req) return;
+  CHECK_EQ(lhs.storage_type(), kCSRStorage);
+  CHECK_EQ(ret->storage_type(), kRowSparseStorage);
+  if (!lhs.storage_initialized()) return;
+
+  using mshadow::Shape1;
+  using mxnet_op::Kernel;
+  using mxnet_op::set_zero;
+  using nnvm::dim_t;
+  mshadow::Stream* s = ctx.get_stream();
+
+  const TBlob data_l = lhs.data();
+  const TBlob indptr_l = lhs.aux_data(csr::kIndPtr);
+  const TBlob col_idx_l = lhs.aux_data(csr::kIdx);
+  const TBlob& data_r = rhs;
+
+  const dim_t num_rows_l = lhs.shape()[0];
+  const dim_t num_cols_l = lhs.shape()[1];
+  const dim_t num_cols_r = rhs.shape_[1];
+  const dim_t threads_per_warp = mxnet_op::cuda_get_device_prop().warpSize;
+  dim_t num_threads;
+  // TODO: remove kernel dependency on warpSize=32
+  if (threads_per_warp != 32) {
+LOG(FATAL) << "DotCsrDnsRspImpl GPU kernels expect warpSize=32";
+  }
+
+  MSHADOW_SGL_DBL_TYPE_SWITCH(data_l.type_flag_, DType, {  // data type
+MSHADOW_IDX_TYPE_SWITCH(indptr_l.type_flag_, IType, {  // indptr type
+  MSHADOW_IDX_TYPE_SWITCH(col_idx_l.type_flag_, CType, {  // col idx type
+if (trans_lhs) {
+  // Compute number of non-zero rows (nnr) of output matrix
+  // - alloc temp storage for row_flg array and for cub's prefix sum
+  // - mark non-zero columns of csr matrix in row_flg
+  // - compute inclusive prefix sum over marked array
+  // - copy last value (nnr_out) from device to host
+  dim_t* row_flg_out = NULL;
+  void* d_temp_storage = NULL;
+  size_t temp_storage_bytes = 0;
+  cub::DeviceScan::InclusiveSum(d_temp_storage,
+temp_storage_bytes,
+row_flg_out,
+row_flg_out,
+num_cols_l,
+mshadow::Stream::GetStream(s));
+  mshadow::Tensor workspace = ctx.requested[0]
+  .get_space_typed(Shape1(num_cols_l*sizeof(dim_t)+temp_storage_bytes), s);
+  row_flg_out = reinterpret_cast(workspace.dptr_);
+  d_temp_storage = workspace.dptr_ + num_cols_l*sizeof(dim_t);
+  num_threads = num_cols_l;
+  Kernel::Launch(s, num_threads, row_flg_out);
+  num_threads = num_rows_l * threads_per_warp;
+  Kernel::Launch(s, num_threads,
+  row_flg_out, col_idx_l.dptr(), indptr_l.dptr(),
+  num_rows_l, num_cols_l);
+  cub::DeviceScan::InclusiveSum(d_temp_storage,
+temp_storage_bytes,
+row_flg_out,
+row_flg_out,
+num_cols_l,
+mshadow::Stream::GetStream(s));
+  dim_t nnr_out = 0;
+  CUDA_CALL(cudaMemcpy(_out, _flg_out[num_cols_l-1], 
sizeof(dim_t),
+   cudaMemcpyDeviceToHost));
+
+  // Allocate output matrix space
+  ret->CheckAndAlloc({Shape1(nnr_out)});
+  const TBlob data_out_blob = ret->data();
+  const TBlob row_idx_out_blob = ret->aux_data(rowsparse::kIdx);
+  MSHADOW_IDX_TYPE_SWITCH(row_idx_out_blob.type_flag_, RType, {  // 
row idx type
+DType* data_out = data_out_blob.dptr();
+RType* row_idx_out = row_idx_out_blob.dptr();
+if (kWriteTo == req) {
+  num_threads = nnr_out * num_cols_r;
+  Kernel::Launch(s, num_threads, data_out);
+}
+num_threads = nnr_out;
+Kernel::Launch(s, num_threads, row_idx_out);
+
+// Fill row_idx array of output matrix, using the row_flg values
+num_threads = num_cols_l;
+Kernel::Launch(s, num_threads,
+row_idx_out, row_flg_out, num_cols_l);
+
+   

[GitHub] rahul003 commented on issue #7321: fixes broken compilation by including tensor_blob

2017-08-08 Thread git
rahul003 commented on issue #7321: fixes broken compilation by including 
tensor_blob
URL: https://github.com/apache/incubator-mxnet/pull/7321#issuecomment-320741353
 
 
   @piiswrong So what needs to be done to ensure mxnet compiles fine?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on issue #7376: MXbox -- a simple and flexible vision toolbox for mxnet framework.

2017-08-08 Thread git
piiswrong commented on issue #7376: MXbox -- a simple and flexible vision 
toolbox for mxnet framework.
URL: 
https://github.com/apache/incubator-mxnet/issues/7376#issuecomment-321037816
 
 
   Thanks a lot for the contribution. This looks pretty similar to the recently 
introduced gluon utilities.
   
   see gluon.data and gluon.model_zoo. Would you be interested in merging mxbox 
into gluon?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7377: gluon.nn.Conv2D initialization int stride not handled correctly

2017-08-08 Thread git
szha commented on issue #7377: gluon.nn.Conv2D initialization int stride not 
handled correctly
URL: 
https://github.com/apache/incubator-mxnet/issues/7377#issuecomment-321034194
 
 
   @zhanghang1989 @Jerryzcn Could you send a minimum example?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mli commented on a change in pull request #7379: Add license header

2017-08-08 Thread git
mli commented on a change in pull request #7379: Add license header
URL: https://github.com/apache/incubator-mxnet/pull/7379#discussion_r131985346
 
 

 ##
 File path: src/operator/softmax_activation.cu
 ##
 @@ -1,5 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 /*!
- * Copyright (c) 2015 by Contributors
  * \file softmax_activation.cu
  * \brief
 
 Review comment:
   technically it is hard, need to write more codes to merge two headers. i'd 
like to put it into the future works.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7382: GRU not working with layout 'NTC'

2017-08-08 Thread git
szha commented on issue #7382: GRU not working with layout 'NTC'
URL: 
https://github.com/apache/incubator-mxnet/issues/7382#issuecomment-321029686
 
 
   Looks like a bug in handling the unfused states. I'm looking into the fix.
   ```
   In [2]: layer.state_info()
   Out[2]: [{'__layout__': 'LNC', 'shape': (2, 0, 100)}]
   In [4]: layer._unfuse().state_info()
   
   Out[4]:
   [{'__layout__': 'NC', 'shape': (0, 100)},
{'__layout__': 'NC', 'shape': (0, 100)}]
   ```
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-08 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r131982231
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -187,8 +187,8 @@ inline bool DotForwardInferStorageType(const 
nnvm::NodeAttrs& attrs,
   CHECK_EQ(out_attrs->size(), 1U);
   const DotParam& param = nnvm::get(attrs.parsed);
   // csr has many zero columns, so the result of dot(csr.T, matrix) should be 
rsp
-  // dot(csr.T,dns)=rsp not yet implemented on gpu
-  if (param.transpose_a && kCSRStorage == (*in_attrs)[0] && ctx.dev_type != 
Context::kGPU) {
+  // TODO(stefan/haibin): don't enforce kRowSparseStorage if out_attrs has 
already been set
+  if (param.transpose_a && kCSRStorage == (*in_attrs)[0]) {
 STORAGE_TYPE_ASSIGN_CHECK(*out_attrs, 0, kRowSparseStorage);
 
 Review comment:
   @reminisce 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-08 Thread git
piiswrong commented on a change in pull request #7363: Add tensorboard 
configure into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r131982184
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -168,10 +168,16 @@ def fit(args, network, data_loader, **kwargs):
 
 # callbacks that run after each batch
 batch_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
+eval_end_callbacks = []
 if 'batch_end_callback' in kwargs:
 cbs = kwargs['batch_end_callback']
 batch_end_callbacks += cbs if isinstance(cbs, list) else [cbs]
 
+# tensorboard logs
+if "eval_end_callback" in kwargs:
+   cbs = kwargs['eval_end_callback']
+eval_end_callbacks += cbs if isinstance(cbs, list) else [cbs]
 
 Review comment:
   indentation.
   Have you verified that this runs?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-08 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r131982060
 
 

 ##
 File path: src/operator/tensor/dot-inl.cuh
 ##
 @@ -353,27 +640,308 @@ inline void DotCsrDnsDnsImpl(mshadow::Stream* s,
 }
 
 /*!
- * \brief Impl of dot(csr.T, dns) = rsp
+ * \brief GPU Impl of dot(csr, dns) = rsp and dot(csr.T, dns) = rsp
  */
-inline void DotCsrDnsRspImpl(mshadow::Stream* s,
+inline void DotCsrDnsRspImpl(const OpContext& ctx,
+ const gpu& gpu_dev,
  const NDArray& lhs,
  const TBlob& rhs,
  const OpReqType req,
  const bool trans_lhs,
  NDArray* ret) {
-  LOG(FATAL) << "DotCsrDnsRspImpl gpu version is not implemented.";
+  if (kNullOp == req) return;
+  CHECK_EQ(lhs.storage_type(), kCSRStorage);
+  CHECK_EQ(ret->storage_type(), kRowSparseStorage);
+  if (!lhs.storage_initialized()) return;
+
+  using mshadow::Shape1;
+  using mxnet_op::Kernel;
+  using mxnet_op::set_zero;
+  using nnvm::dim_t;
+  mshadow::Stream* s = ctx.get_stream();
+
+  const TBlob data_l = lhs.data();
+  const TBlob indptr_l = lhs.aux_data(csr::kIndPtr);
+  const TBlob col_idx_l = lhs.aux_data(csr::kIdx);
+  const TBlob& data_r = rhs;
+
+  const dim_t num_rows_l = lhs.shape()[0];
+  const dim_t num_cols_l = lhs.shape()[1];
+  const dim_t num_cols_r = rhs.shape_[1];
+  const dim_t threads_per_warp = mxnet_op::cuda_get_device_prop().warpSize;
+  dim_t num_threads;
+  // TODO: remove kernel dependency on warpSize=32
+  if (threads_per_warp != 32) {
+LOG(FATAL) << "DotCsrDnsRspImpl GPU kernels expect warpSize=32";
+  }
+
+  MSHADOW_SGL_DBL_TYPE_SWITCH(data_l.type_flag_, DType, {  // data type
+MSHADOW_IDX_TYPE_SWITCH(indptr_l.type_flag_, IType, {  // indptr type
+  MSHADOW_IDX_TYPE_SWITCH(col_idx_l.type_flag_, CType, {  // col idx type
+if (trans_lhs) {
+  // Compute number of non-zero rows (nnr) of output matrix
+  // - alloc temp storage for row_flg array and for cub's prefix sum
+  // - mark non-zero columns of csr matrix in row_flg
+  // - compute inclusive prefix sum over marked array
+  // - copy last value (nnr_out) from device to host
+  dim_t* row_flg_out = NULL;
+  void* d_temp_storage = NULL;
+  size_t temp_storage_bytes = 0;
+  cub::DeviceScan::InclusiveSum(d_temp_storage,
+temp_storage_bytes,
+row_flg_out,
+row_flg_out,
+num_cols_l,
+mshadow::Stream::GetStream(s));
+  mshadow::Tensor workspace = ctx.requested[0]
+  .get_space_typed(Shape1(num_cols_l*sizeof(dim_t)+temp_storage_bytes), s);
+  row_flg_out = reinterpret_cast(workspace.dptr_);
+  d_temp_storage = workspace.dptr_ + num_cols_l*sizeof(dim_t);
+  num_threads = num_cols_l;
+  Kernel::Launch(s, num_threads, row_flg_out);
+  num_threads = num_rows_l * threads_per_warp;
+  Kernel::Launch(s, num_threads,
+  row_flg_out, col_idx_l.dptr(), indptr_l.dptr(),
+  num_rows_l, num_cols_l);
+  cub::DeviceScan::InclusiveSum(d_temp_storage,
+temp_storage_bytes,
+row_flg_out,
+row_flg_out,
+num_cols_l,
+mshadow::Stream::GetStream(s));
+  dim_t nnr_out = 0;
+  CUDA_CALL(cudaMemcpy(_out, _flg_out[num_cols_l-1], 
sizeof(dim_t),
+   cudaMemcpyDeviceToHost));
+
+  // Allocate output matrix space
+  ret->CheckAndAlloc({Shape1(nnr_out)});
+  const TBlob data_out_blob = ret->data();
+  const TBlob row_idx_out_blob = ret->aux_data(rowsparse::kIdx);
+  MSHADOW_IDX_TYPE_SWITCH(row_idx_out_blob.type_flag_, RType, {  // 
row idx type
+DType* data_out = data_out_blob.dptr();
+RType* row_idx_out = row_idx_out_blob.dptr();
+if (kWriteTo == req) {
+  num_threads = nnr_out * num_cols_r;
+  Kernel::Launch(s, num_threads, data_out);
+}
+num_threads = nnr_out;
+Kernel::Launch(s, num_threads, row_idx_out);
+
+// Fill row_idx array of output matrix, using the row_flg values
+num_threads = num_cols_l;
+Kernel::Launch(s, num_threads,
+row_idx_out, row_flg_out, num_cols_l);
+
+   

[GitHub] piiswrong commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-08 Thread git
piiswrong commented on a change in pull request #7363: Add tensorboard 
configure into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r131981997
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -168,10 +168,16 @@ def fit(args, network, data_loader, **kwargs):
 
 # callbacks that run after each batch
 batch_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
+eval_end_callbacks = []
 if 'batch_end_callback' in kwargs:
 cbs = kwargs['batch_end_callback']
 batch_end_callbacks += cbs if isinstance(cbs, list) else [cbs]
 
+# tensorboard logs
+if "eval_end_callback" in kwargs:
+   cbs = kwargs['eval_end_callback']
+eval_end_callbacks += cbs if isinstance(cbs, list) else [cbs]
 
 Review comment:
   why not assign directly here?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7356: decouple record/train and add state readers

2017-08-08 Thread git
piiswrong commented on a change in pull request #7356: decouple record/train 
and add state readers
URL: https://github.com/apache/incubator-mxnet/pull/7356#discussion_r131980722
 
 

 ##
 File path: tests/python/unittest/test_autograd.py
 ##
 @@ -251,18 +251,49 @@ def test_attach_grad():
 def test_is_train():
 x = mx.nd.ones((10, 10))
 x.attach_grad()
-with record(True):
+with record(train_mode=True):
+assert is_recording()
+assert is_training()
 y = mx.nd.Dropout(x, p=0.5)
 assert y.asnumpy().max() == 2 and y.asnumpy().min() == 0
 y.backward()
 assert (x.grad.asnumpy() == y.asnumpy()).all()
 
-with record(False):
+with predict_mode():
+assert is_recording()
+assert not is_training()
+y = mx.nd.Dropout(x, p=0.5)
+assert (y.asnumpy() == x.asnumpy()).all()
+y.backward(is_train=False)
+assert (x.grad.asnumpy() == x.asnumpy()).all()
+
+with record(train_mode=False):
+assert is_recording()
+assert not is_training()
 y = mx.nd.Dropout(x, p=0.5)
 assert (y.asnumpy() == x.asnumpy()).all()
 y.backward(is_train=False)
 
 Review comment:
   change this to train_mode too
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-08 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r131980446
 
 

 ##
 File path: src/operator/tensor/dot-inl.cuh
 ##
 @@ -9,66 +9,163 @@
 #include 
 #include 
 
+#include 
+
 namespace mxnet {
 namespace op {
-using mshadow::cuda::kBaseThreadNum;
 
 /*!
- * \brief Scalar kernel of dot(csr, dns1) = dns2
+ * \brief GPU auxiliary kernel to flag non-zero rows of an rsp matrix with 
indices.
+ * Parallelized by matrix rows: 1 thread/row
+ */
+struct SetRspRowFlgKernel {
+  /*!
+   * \brief
+   * \param tid  global thread id
+   * \param row_flg  array to flag storage indices of non-zero rows
+   * \param row_idx  rsp matrix row index array storing indices of non-zero 
rows
+   * \param nnr  rsp matrix number of non-zero rows (storage shape)
+   */
+  template
+  __device__ __forceinline__ static void Map(int tid,
+ RType* row_flg,
+ const RType* row_idx,
+ const nnvm::dim_t nnr) {
+if (tid < nnr) {
+  row_flg[row_idx[tid]] = tid+1;
+}
+  }
+};
+
+/*!
+ * \brief GPU auxiliary kernel for marking non-zero columns of a csr matrix.
+ * Parallelized by matrix rows: 1 warp/row
+ */
+struct MarkCsrZeroColsWarpKernel {
+  /*!
+   * \brief
+   * \param tid   global thread id
+   * \param col_idx   csr matrix column indices
+   * \param indptrcsr matrix row index pointer
+   * \param num_rows  csr matrix number of rows
+   * \param num_cols  csr matrix number of columns
+   */
+  template
+  __device__ __forceinline__ static void Map(int tid,
+ nnvm::dim_t* flg,
+ const CType* col_idx,
+ const IType* indptr,
+ const nnvm::dim_t num_rows,
+ const nnvm::dim_t num_cols) {
+typedef unsigned long long int uint64_cu;
+static_assert(sizeof(uint64_cu) == sizeof(nnvm::dim_t), "unexpected sizeof 
dim_t");
+
+const nnvm::dim_t warp_id = tid / 32;  // global warp   id
+const nnvm::dim_t lane= tid & (32-1);  // local  thread id within warp
+
+if (warp_id < num_rows) {
+  uint64_cu zero = 0;
+  uint64_cu one = 1;
+  for (IType j = indptr[warp_id]+lane; j < indptr[warp_id+1]; j+=32) {
 
 Review comment:
   I'd hope that the atomicCAS is faster anyway since less writing is done. 
Will let you know later.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7356: decouple record/train and add state readers

2017-08-08 Thread git
piiswrong commented on a change in pull request #7356: decouple record/train 
and add state readers
URL: https://github.com/apache/incubator-mxnet/pull/7356#discussion_r131980348
 
 

 ##
 File path: python/mxnet/autograd.py
 ##
 @@ -106,10 +135,41 @@ def pause(is_train=False):
 
 Parameters
 --
-is_train: bool, default False
-Whether to do forward for training or inference.
+train_mode: bool, default False
+Whether to do forward for training or predicting.
+"""
+return _RecordingStateScope(False, train_mode)
+
+
+def train_mode():
+"""Returns a scope context to be used in 'with' statement
+in which forward pass behavior is set to training mode,
+without changing the recording states.
+
+Example::
+
+y = model(x)
+with autograd.train():
+y = dropout(y)
+
+"""
+return _RecordingStateScope(None, True)
+
+
+def predict_mode():
+"""Returns a scope context to be used in 'with' statement
+in which forward pass behavior is set to inference mode,
+without changing the recording states.
+
+Example::
+
+with autograd.record():
+y = model(x)
+with autograd.test():
 
 Review comment:
   test_mode
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7356: decouple record/train and add state readers

2017-08-08 Thread git
piiswrong commented on a change in pull request #7356: decouple record/train 
and add state readers
URL: https://github.com/apache/incubator-mxnet/pull/7356#discussion_r131980315
 
 

 ##
 File path: python/mxnet/autograd.py
 ##
 @@ -106,10 +135,41 @@ def pause(is_train=False):
 
 Parameters
 --
-is_train: bool, default False
-Whether to do forward for training or inference.
+train_mode: bool, default False
+Whether to do forward for training or predicting.
+"""
+return _RecordingStateScope(False, train_mode)
+
+
+def train_mode():
+"""Returns a scope context to be used in 'with' statement
+in which forward pass behavior is set to training mode,
+without changing the recording states.
+
+Example::
+
+y = model(x)
+with autograd.train():
 
 Review comment:
   train_mode
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-08 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r131979993
 
 

 ##
 File path: src/operator/tensor/dot-inl.cuh
 ##
 @@ -9,66 +9,163 @@
 #include 
 #include 
 
+#include 
+
 namespace mxnet {
 namespace op {
-using mshadow::cuda::kBaseThreadNum;
 
 /*!
- * \brief Scalar kernel of dot(csr, dns1) = dns2
+ * \brief GPU auxiliary kernel to flag non-zero rows of an rsp matrix with 
indices.
+ * Parallelized by matrix rows: 1 thread/row
+ */
+struct SetRspRowFlgKernel {
+  /*!
+   * \brief
+   * \param tid  global thread id
+   * \param row_flg  array to flag storage indices of non-zero rows
+   * \param row_idx  rsp matrix row index array storing indices of non-zero 
rows
+   * \param nnr  rsp matrix number of non-zero rows (storage shape)
+   */
+  template
+  __device__ __forceinline__ static void Map(int tid,
+ RType* row_flg,
+ const RType* row_idx,
+ const nnvm::dim_t nnr) {
+if (tid < nnr) {
+  row_flg[row_idx[tid]] = tid+1;
+}
+  }
+};
+
+/*!
+ * \brief GPU auxiliary kernel for marking non-zero columns of a csr matrix.
+ * Parallelized by matrix rows: 1 warp/row
+ */
+struct MarkCsrZeroColsWarpKernel {
+  /*!
+   * \brief
+   * \param tid   global thread id
+   * \param col_idx   csr matrix column indices
+   * \param indptrcsr matrix row index pointer
+   * \param num_rows  csr matrix number of rows
+   * \param num_cols  csr matrix number of columns
+   */
+  template
+  __device__ __forceinline__ static void Map(int tid,
+ nnvm::dim_t* flg,
+ const CType* col_idx,
+ const IType* indptr,
+ const nnvm::dim_t num_rows,
+ const nnvm::dim_t num_cols) {
+typedef unsigned long long int uint64_cu;
+static_assert(sizeof(uint64_cu) == sizeof(nnvm::dim_t), "unexpected sizeof 
dim_t");
+
+const nnvm::dim_t warp_id = tid / 32;  // global warp   id
+const nnvm::dim_t lane= tid & (32-1);  // local  thread id within warp
+
+if (warp_id < num_rows) {
+  uint64_cu zero = 0;
+  uint64_cu one = 1;
+  for (IType j = indptr[warp_id]+lane; j < indptr[warp_id+1]; j+=32) {
 
 Review comment:
   I can try out the implication - just for fun - but nonetheless race 
conditions should be avoided. Having said that, looking at the more detailed 
kernel runtimes (that I didn't publish above), you'll find that this Kernel 
accounts for less than 1% of the total runtime of the transpose csr dot 
operator. Further optimization would have to happen in the matrix multiply 
itself as it uses up >99% of the total runtime.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7381: fix [#7368] Caffe converter test fails, causing CI to halt for all PRs

2017-08-08 Thread git
piiswrong commented on a change in pull request #7381: fix [#7368] Caffe 
converter test fails, causing CI to halt for all PRs 
URL: https://github.com/apache/incubator-mxnet/pull/7381#discussion_r131979921
 
 

 ##
 File path: tools/caffe_converter/convert_symbol.py
 ##
 @@ -128,6 +128,16 @@ def _parse_proto(prototxt_fname):
 param_string = ''
 skip_layer = False
 name = re.sub('[-/]', '_', layer.name)
+for k in range(len(layer.bottom)):
 
 Review comment:
   why move the code?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: fixes the incorrect retrieval of the batch size in the RNN forward pass. (#7385)

2017-08-08 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 1a617fa  fixes the incorrect retrieval of the batch size in the RNN 
forward pass. (#7385)
1a617fa is described below

commit 1a617fadc3cf612f964722e09571e1b80ad16f68
Author: Peter Schneider 
AuthorDate: Tue Aug 8 19:30:03 2017 +0200

fixes the incorrect retrieval of the batch size in the RNN forward pass. 
(#7385)
---
 python/mxnet/gluon/rnn/rnn_layer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/mxnet/gluon/rnn/rnn_layer.py 
b/python/mxnet/gluon/rnn/rnn_layer.py
index d567369..deb6898 100644
--- a/python/mxnet/gluon/rnn/rnn_layer.py
+++ b/python/mxnet/gluon/rnn/rnn_layer.py
@@ -154,7 +154,7 @@ class _RNNLayer(Block):
 def forward(self, inputs, states):
 if isinstance(states, ndarray.NDArray):
 states = [states]
-batch_size = states[0].shape[self._layout.find('N')]
+batch_size = inputs.shape[self._layout.find('N')]
 for state, info in zip(states, self.state_info(batch_size)):
 if state.shape != info['shape']:
 raise ValueError(

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[incubator-mxnet] branch master updated: Docs for GAN (#7378)

2017-08-08 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new d08abf5  Docs for GAN (#7378)
d08abf5 is described below

commit d08abf54e90382888984ddae70b0da97b4ce9876
Author: Yash 
AuthorDate: Tue Aug 8 10:27:22 2017 -0700

Docs for GAN (#7378)

* gan.md

* fix caps

* fix formatting

* title change
---
 docs/tutorials/unsupervised_learning/gan.md | 386 +++-
 1 file changed, 382 insertions(+), 4 deletions(-)

diff --git a/docs/tutorials/unsupervised_learning/gan.md 
b/docs/tutorials/unsupervised_learning/gan.md
index 6491806..709e132 100644
--- a/docs/tutorials/unsupervised_learning/gan.md
+++ b/docs/tutorials/unsupervised_learning/gan.md
@@ -1,5 +1,383 @@
-# Generative Adversarial Network
-Get the source code for an example of a generative adversarial network (GAN) 
running on MXNet on GitHub in the 
[gan](https://github.com/dmlc/mxnet/tree/master/example/gan) folder.
+# Generative Adversarial Networks
 
-## Next Steps
-* [MXNet tutorials index](http://mxnet.io/tutorials/index.html)
\ No newline at end of file
+GANs are an application of unsupervised learning - you don't need labels for 
your dataset in order to train a GAN.
+ 
+The GAN framework composes of two neural networks: a generator network and a 
discriminator network.
+
+The generator's job is to take a set of random numbers and produce data (such 
as images or text).
+
+The discriminator then takes in that data as well as samples of that data from 
a dataset and tries to determine if is "fake" (created by the generator 
network) or "real" (from the original dataset).
+
+During training, the two networks play a game against each other. The 
generator tries to create realistic data, so that it can fool the discriminator 
into thinking that the data it generated is from the original dataset. At the 
same time, the discriminator tries to not be fooled - it learns to become 
better at determining if data is real or fake.
+
+Since the two networks are fighting in this game, they can be seen as as 
adversaries, which is where the term "Generative Adverserial Network" comes 
from.
+
+## Deep Convolutional Generative Adversarial Networks
+
+This tutorial takes a look at Deep Convolutional Generative Adversarial 
Networks (DCGAN), which combines Convolutional Neural Networks (CNNs) and GANs.
+
+We will create a DCGAN that is able to create images of handwritten digits 
from random numbers.The tutorial uses the neural net architecture and 
guidelines outlined in [this paper](https://arxiv.org/abs/1511.06434), and the 
MNIST dataset.
+
+##How to Use This Tutorial
+You can use this tutorial by executing each snippet of python code in order as 
it appears in the tutorial.
+
+
+1. The first net is the "generator" and creates images of handwritten digits 
from random numbers.
+2. The second net is the "discriminator" and determines if the image created 
by the generator is real (a realistic looking image of handwritten digits) or 
fake (an image that doesn't look like it came from the original dataset).
+
+Apart from creating a DCGAN, you'll also learn:
+
+- How to manipulate and iterate through batches images that you can feed into 
your neural network.
+
+- How to create a custom MXNet data iterator that generates random numbers 
from a normal distribution.
+
+- How to create a custom training process in MXNet, using lower level 
functions from the MXNet Module API such as .bind() .forward() and .backward(). 
The training process for a DCGAN is more complex than many other neural net's, 
so we need to use these functions instead of using the higher level .fit() 
function.
+
+- How to visualize images as they are going through the training process
+
+## Prerequisites
+
+This tutorial assumes you're familiar with the concept of CNN's and have 
implemented one in MXNet. You should also be familiar with the concept of 
logistic regression. Having a basic understanding for MXNet data iterators 
helps, since we'll create a custom Data Iterator to iterate though random 
numbers as inputs to our generator network. 
+
+This example is designed to be trained on a single GPU. Training this network 
on CPU can be slow, so it's recommended that you use a GPU for training.
+
+To complete this tutorial, you need:
+
+- MXNet
+- Python 2.7, and the following libraries for Python:
+- Numpy - for matrix math
+- OpenCV - for image manipulation
+- Scikit-learn - to easily get our dataset
+- Matplotlib - to visualize our output
+
+## The Data
+We need two pieces of data to train our DCGAN:
+1. Images of handwritten digits from the MNIST dataset
+2. Random numbers from a normal distribution
+
+Our generator network will use the random numbers as the input to produce 
images of 

[GitHub] piiswrong closed pull request #7378: Docs for GAN

2017-08-08 Thread git
piiswrong closed pull request #7378: Docs for GAN
URL: https://github.com/apache/incubator-mxnet/pull/7378
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7379: Add license header

2017-08-08 Thread git
piiswrong commented on a change in pull request #7379: Add license header
URL: https://github.com/apache/incubator-mxnet/pull/7379#discussion_r131977890
 
 

 ##
 File path: src/operator/softmax_activation.cu
 ##
 @@ -1,5 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 /*!
- * Copyright (c) 2015 by Contributors
  * \file softmax_activation.cu
  * \brief
 
 Review comment:
   I think the original header needs to be removed
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] LakeCarrot commented on issue #7341: Usage of Tensorboard in Distributed MXNet

2017-08-08 Thread git
LakeCarrot commented on issue #7341: Usage of Tensorboard in Distributed MXNet
URL: 
https://github.com/apache/incubator-mxnet/issues/7341#issuecomment-321013823
 
 
   @zihaolucky Good to know. Thanks a lot!
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] LakeCarrot closed issue #7341: Usage of Tensorboard in Distributed MXNet

2017-08-08 Thread git
LakeCarrot closed issue #7341: Usage of Tensorboard in Distributed MXNet
URL: https://github.com/apache/incubator-mxnet/issues/7341
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] edmBernard commented on issue #6999: bgr or rgb input to vgg16?

2017-08-08 Thread git
edmBernard commented on issue #6999: bgr or rgb input to vgg16?
URL: 
https://github.com/apache/incubator-mxnet/issues/6999#issuecomment-321003813
 
 
   ho shit ... 
   you are right in the exemple : 
http://mxnet.io/tutorials/python/predict_image.html
   images are converted in RGB.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] edmBernard commented on issue #6999: bgr or rgb input to vgg16?

2017-08-08 Thread git
edmBernard commented on issue #6999: bgr or rgb input to vgg16?
URL: 
https://github.com/apache/incubator-mxnet/issues/6999#issuecomment-321003813
 
 
   ho shit ... 
   you are write in the exemple : 
http://mxnet.io/tutorials/python/predict_image.html
   images are converted in RGB.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing commented on issue #7273: [R] call im2rec in R

2017-08-08 Thread git
thirdwing commented on issue #7273: [R] call im2rec in R
URL: 
https://github.com/apache/incubator-mxnet/issues/7273#issuecomment-320985009
 
 
   First, OpenCV is optional. It is not available in the pre-built pkg. 
However, you can add OpenCV support when compiling from source.
   
   Second, I don't think we need to implement `im2rec` in R, since we have a 
[C++ 
implementation](https://github.com/apache/incubator-mxnet/blob/master/tools/im2rec.cc).
 We just need to call it from R. This is almost done in 
https://github.com/thirdwing/mxnet/tree/iss7273
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing commented on issue #7273: [R] call im2rec in R

2017-08-08 Thread git
thirdwing commented on issue #7273: [R] call im2rec in R
URL: 
https://github.com/apache/incubator-mxnet/issues/7273#issuecomment-320985009
 
 
   First, OpenCV is optional. It is not available in the pre-built pkg. 
However, you add OpenCV support when compiling from source.
   
   Second, I don't think we need to implement `im2rec` in R, since we have a 
[C++ 
implementation](https://github.com/apache/incubator-mxnet/blob/master/tools/im2rec.cc).
 We just need to call it from R. This is almost done in 
https://github.com/thirdwing/mxnet/tree/iss7273
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coolbrain commented on issue #6999: bgr or rgb input to vgg16?

2017-08-08 Thread git
coolbrain commented on issue #6999: bgr or rgb input to vgg16?
URL: 
https://github.com/apache/incubator-mxnet/issues/6999#issuecomment-320979533
 
 
   But mxnet change as RGB in implementation.  Are you sure? @edmBernard  
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] kimtang commented on issue #7273: [R] call im2rec in R

2017-08-08 Thread git
kimtang commented on issue #7273: [R] call im2rec in R
URL: 
https://github.com/apache/incubator-mxnet/issues/7273#issuecomment-320959689
 
 
   Yes, it should not be that difficult but im2rec depends on opencv and this 
is not available in R. Can someone please confirm? 
   As far as I can see we need to export the functions 
MXRecordIOWriterCreate,MXRecordIOReaderReadRecord,MXRecordIOWriterWriteRecord 
and MXRecordIOReaderFree to R. And this is done in mxnetR is by registering 
these functions using something like MXNET_REGISTER_IO_ITER. See 
~\src\io\iter_image_recordio_2.cc (line 599).
   
   If we are able to adapt this then it should be fairly simple to write the 
im2rec function in R.
   
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] train-test-laura commented on issue #7364: MxnetR chunk-wise neural nets

2017-08-08 Thread git
train-test-laura commented on issue #7364: MxnetR chunk-wise neural nets
URL: 
https://github.com/apache/incubator-mxnet/issues/7364#issuecomment-320941845
 
 
   Thanks for your reply.
   
   I have found that page already pretty helpful, but there are a few questions 
I have - maybe you or someone else could help me.
   
   First of, I am not sure what the output named "flatten_output" is - I 
thought for me it could be softmax_output as well, not sure. 
   
   There, I am also not sure what to put in "Input Shape". - the dimensions of 
the original data set? the dimensions of the neural net? I am lost...
   
   Any help would be great!
   Thanks
   Laura 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] train-test-laura commented on issue #7364: MxnetR chunk-wise neural nets

2017-08-08 Thread git
train-test-laura commented on issue #7364: MxnetR chunk-wise neural nets
URL: 
https://github.com/apache/incubator-mxnet/issues/7364#issuecomment-320941845
 
 
   Thanks for your reply.
   
   I have found that page already pretty helpful, but there are a few questions 
I have - maybe you or someone else could help me.
   
   First of, I am not sure what the output named "flatten_output" is - I 
thought for me it could be softmax_output as well, not sure. 
   
   For mx.model.init.params: I get the error:  could not find function 
"mx.model.init.params"
   There, I am also not sure what to put in "Input Shape". - the dimensions of 
the original data set? the dimensions of the neural net? I am lost...
   
   Any help would be great!
   Thanks
   Laura 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] alfredtofu opened a new issue #7387: c_predict_api doesnot support multi predictor

2017-08-08 Thread git
alfredtofu opened a new issue #7387: c_predict_api doesnot support multi 
predictor 
URL: https://github.com/apache/incubator-mxnet/issues/7387
 
 
   It seems that c_predict_api doesnot  support create multi predictor on 
different devices(gpus) in one program and it will raise `invalid device 
function` error.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] qingzhouzhen opened a new issue #7386: How could I define function for GPU only?

2017-08-08 Thread git
qingzhouzhen opened a new issue #7386: How could I define function for GPU only?
URL: https://github.com/apache/incubator-mxnet/issues/7386
 
 
   I need  to define a function in .h file for GPU version only, then implenent 
it in .cu file, 
   declaration in .h:
   ```
void channelwise_Forward(mshadow::Stream *stream,
 const std::vector _data,
 const std::vector _data);
 void channelwise_Backward_input(mshadow::Stream *stream,
 const std::vector _data,
 const std::vector _grad,
 const std::vector _grad);  
 void channelwise_Backward_filter(mshadow::Stream *stream,
 const std::vector _data,
 const std::vector _grad,
 const std::vector _grad);   
  
   
   #if MXNET_USE_CUDA
 void channelwise_Forward(mshadow::Stream *stream,
 const std::vector _data,
 const std::vector _data);
 void channelwise_Backward_input(mshadow::Stream *stream,
 const std::vector _data,
 const std::vector _grad,
 const std::vector _grad);  
 void channelwise_Backward_filter(mshadow::Stream *stream,
 const std::vector _data,
 const std::vector _grad,
 const std::vector _grad); 
   ```
   implement in .cu file:
   ```
   void ConvolutionOp::channelwise_Forward(mshadow::Stream 
*stream,
 const std::vector _data,
 const std::vector _data) {
 using namespace mxnet_op;
.
   }
   ```
   the problem is I am force to declare the same function for CPU version and 
implement it, or it will compile failed
   I just need the function for GPU, How could I get ride of this problem?

 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] peschn opened a new pull request #7385: fix[#7382] fixes how the batch size is obtained in RNN forward pass.

2017-08-08 Thread git
peschn opened a new pull request #7385: fix[#7382] fixes how the batch size is 
obtained in RNN forward pass.
URL: https://github.com/apache/incubator-mxnet/pull/7385
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] solin319 opened a new issue #7384: Parameter 'dtype' in the function 'ImageRecordIter' doesn't work

2017-08-08 Thread git
solin319 opened a new issue #7384: Parameter 'dtype' in the function 
'ImageRecordIter' doesn't work
URL: https://github.com/apache/incubator-mxnet/issues/7384
 
 
   In mxnet-0.10 version, I add 'dtype = float16', 'dtype = float64', 'dtype = 
uint8' in the function 'ImageRecordIter' in 
example/image-classifacation/common/data.py.  But the data read from this 
function is always  'float32' .
   
   I find this parameter only used in the 266 line of the file 
iter_image_recordio_2.cc. It pass a new type to a variable 'dtype'. But this 
variable was no longer be used.
   
   Is it a bug? 
   How can I read data in float16 format?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] edmBernard commented on issue #6999: bgr or rgb input to vgg16?

2017-08-08 Thread git
edmBernard commented on issue #6999: bgr or rgb input to vgg16?
URL: 
https://github.com/apache/incubator-mxnet/issues/6999#issuecomment-320911298
 
 
   I think it's bgr as opencv convention.
   when i use my model I keep opencv color order
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] githubfragments closed issue #7380: strange phenomenon: 1080Ti is slower than maxwell gtx titan x. How to analysis the results of Profiler?

2017-08-08 Thread git
githubfragments closed issue #7380: strange phenomenon: 1080Ti is slower than 
maxwell gtx titan x. How to analysis the results of Profiler?
URL: https://github.com/apache/incubator-mxnet/issues/7380
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] githubfragments commented on issue #7380: strange phenomenon: 1080Ti is slower than maxwell gtx titan x. How to analysis the results of Profiler?

2017-08-08 Thread git
githubfragments commented on issue #7380: strange phenomenon: 1080Ti is slower 
than maxwell gtx titan x. How to analysis the results of Profiler?
URL: 
https://github.com/apache/incubator-mxnet/issues/7380#issuecomment-320909103
 
 
   I have find where the bottleneck is. @edmBernard . 
   I have custom the metric. And the metric update takes 1.4s in E5-2620, 
however, 1.0s in i7-4790K. So the cycle of 1080ti is so big.
   Thank you!
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] edmBernard commented on issue #7380: strange phenomenon: 1080Ti is slower than maxwell gtx titan x. How to analysis the results of Profiler?

2017-08-08 Thread git
edmBernard commented on issue #7380: strange phenomenon: 1080Ti is slower than 
maxwell gtx titan x. How to analysis the results of Profiler?
URL: 
https://github.com/apache/incubator-mxnet/issues/7380#issuecomment-320886272
 
 
   I don't know for gpu driver and cuda version. But cudnn version have a large 
impact on performance
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] githubfragments commented on issue #7380: strange phenomenon: 1080Ti is slower than maxwell gtx titan x. How to analysis the results of Profiler?

2017-08-08 Thread git
githubfragments commented on issue #7380: strange phenomenon: 1080Ti is slower 
than maxwell gtx titan x. How to analysis the results of Profiler?
URL: 
https://github.com/apache/incubator-mxnet/issues/7380#issuecomment-320883014
 
 
   Model checkpoint is written every 10 epoch. Both of the hard drives are 7200 
rpm. Will  gpu driver,  cuda, cudnn version impact the performance?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] edmBernard commented on issue #7380: strange phenomenon: 1080Ti is slower than maxwell gtx titan x. How to analysis the results of Profiler?

2017-08-08 Thread git
edmBernard commented on issue #7380: strange phenomenon: 1080Ti is slower than 
maxwell gtx titan x. How to analysis the results of Profiler?
URL: 
https://github.com/apache/incubator-mxnet/issues/7380#issuecomment-320881324
 
 
   maybe a stupid question but did you write model checkpoint at the end of 
iteration ? 
   Have you the same hard drive writing speed ?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] buaacszj opened a new issue #7383: How to build a library without the BLAS dependency?

2017-08-08 Thread git
buaacszj opened a new issue #7383: How to build a library without the BLAS 
dependency?
URL: https://github.com/apache/incubator-mxnet/issues/7383
 
 
   As I saw from mxnet document "Deep Learning in a Single File for Smart 
Devices", there is a word saying "MXNet provides an amalgamation script that 
compiles all code needed for prediction based on trained DL models into a 
single .cc file, containing approximately 30K lines of code. This code only 
depends on the BLAS library. Moreover, we?ve also created an even more minimal 
version, with the BLAS dependency removed."
   
   But I didn't find any description about how to build the minimal version 
that without BLAS dependency. Could anyone tell me anything about this? Any 
help is appreciated, thanks!
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coolbrain commented on issue #6999: bgr or rgb input to vgg16?

2017-08-08 Thread git
coolbrain commented on issue #6999: bgr or rgb input to vgg16?
URL: 
https://github.com/apache/incubator-mxnet/issues/6999#issuecomment-320878728
 
 
   I want to know this, too. Is the vgg16 model trained by mxnex or just 
converted from caffe model?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] peschn opened a new issue #7382: GRU not working with layout 'NTC'

2017-08-08 Thread git
peschn opened a new issue #7382: GRU not working with layout 'NTC'
URL: https://github.com/apache/incubator-mxnet/issues/7382
 
 
   For bugs or installation issues, please provide the following information.
   The more information you provide, the more likely people will be able to 
help you.
   
   ## Environment info
   Operating System: Ubuntu 16.04.2 LTS
   
   Package used (Python/R/Scala/Julia): Python
   
   MXNet version: mxnet-cu80==0.10.1b20170803
   
   If you are using python package, please provide
   
   Python version and distribution: python 2.7.13, used with anaconda 4.2.23
   
   R `sessionInfo()`:
   
   ## Error Message:
   Please paste the full error message, including stack trace.
   
   ???
   Traceback (most recent call last):
 File "simply/mx/test_rnn.py", line 14, in 
   output, hn = layer(input, h0)
 File 
"/home/huxley/dev/miniconda2/envs/mxnet/lib/python2.7/site-packages/mxnet/gluon/block.py",
 line 251, in __call__
   return self.forward(*args)
 File 
"/home/huxley/dev/miniconda2/envs/mxnet/lib/python2.7/site-packages/mxnet/gluon/rnn/rnn_layer.py",
 line 162, in forward
   str(info['shape']), str(state.shape)))
   ValueError: Invalid recurrent state shape. Expecting (2, 2L, 100), got (2L, 
8L, 100L).
   ???
   
   ## Minimum reproducible example
   if you are using your own code, please provide a short script that 
reproduces the error.
   
   ## Steps to reproduce
   or if you are running standard examples, please provide the commands you 
have run that lead to the error.
   
   ???python
   import mxnet as mx
   
   batch_size = 8
   timesteps = 7
   nhidden = 100
   layers = 2
   nin = 10
   
   layer = mx.gluon.rnn.GRU(nhidden, layers, layout='NTC')
   layer.initialize()
   
   input = mx.nd.random_uniform(shape=(batch_size, timesteps, nin))
   h0 = mx.nd.random_uniform(shape=(layers, batch_size, nhidden))
   output, hn = layer(input, h0)
   ???
   ## What have you tried to solve it?
   
   The only thing that solves it is changing the layout (and the data 
accordingly) to 'TNC'.
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] joey2014 opened a new pull request #7381: fix [#7368] Caffe converter test fails, causing CI to halt for all PRs

2017-08-08 Thread git
joey2014 opened a new pull request #7381: fix [#7368] Caffe converter test 
fails, causing CI to halt for all PRs 
URL: https://github.com/apache/incubator-mxnet/pull/7381
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] joey2014 commented on issue #7368: Caffe converter test fails, causing CI to halt for all PRs

2017-08-08 Thread git
joey2014 commented on issue #7368: Caffe converter test fails, causing CI to 
halt for all PRs
URL: 
https://github.com/apache/incubator-mxnet/issues/7368#issuecomment-320869584
 
 
   The layer input name in some cases is changed which causes the layer added  
to group by mistake, for example, in vgg16, the layer fc6 input name pool5 is 
changed to flatten_0. Moving the state recording code to the begin of the 
function can fix the issue. detail see [the 
fix](https://github.com/mview/mxnet/commit/d171637e99c9b6ffab7a556c91ccac40d9129ab6)
 .
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7264: gluon conv rnns

2017-08-08 Thread git
szha commented on issue #7264: gluon conv rnns
URL: https://github.com/apache/incubator-mxnet/pull/7264#issuecomment-320868244
 
 
   Somehow the tests fail in MKLConcatOp in the MKL variant. @ykim362 any idea 
what this is?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7356: decouple record/train and add state readers

2017-08-08 Thread git
szha commented on issue #7356: decouple record/train and add state readers
URL: https://github.com/apache/incubator-mxnet/pull/7356#issuecomment-320867252
 
 
   Doc for autograd can be found at 
http://mxnet-doc.s3-website-us-east-1.amazonaws.com/api/python/autograd.html
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] edmBernard commented on issue #7380: strange phenomenon: 1080Ti is slower than maxwell gtx titan x. How to analysis the results of Profiler?

2017-08-08 Thread git
edmBernard commented on issue #7380: strange phenomenon: 1080Ti is slower than 
maxwell gtx titan x. How to analysis the results of Profiler?
URL: 
https://github.com/apache/incubator-mxnet/issues/7380#issuecomment-320862930
 
 
   Are you sure the CPU is not the bottleneck ? 
   I just see there is 4 versions of  e5-2620. The v4 is amost equivalent to 
i7-4790k but the v1 is 70% slower.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jeremiedb commented on issue #7375: Can I set instance weight when training?

2017-08-08 Thread git
jeremiedb commented on issue #7375: Can I set instance weight when training?
URL: 
https://github.com/apache/incubator-mxnet/issues/7375#issuecomment-320860659
 
 
   The default behavior when using `predict` function on a model with MakeLoss 
is to get the inference on the latest layer, which is the one where the loss 
function is defined. You can either retro-fit the the actual predictions 
knowing the labels and weight, or more simply, get the predictions for the 
layer previous to MakeLoss where the preds are defined. 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] novioleo commented on issue #5224: include/dmlc/logging.h:235: [00:59:21] src/io/local_filesys.cc:154: Check failed: allow_null LocalFileSystem: fail to open "model/det1-symbol.json"

2017-08-08 Thread git
novioleo commented on issue #5224: include/dmlc/logging.h:235: [00:59:21] 
src/io/local_filesys.cc:154: Check failed: allow_null  LocalFileSystem: fail to 
open "model/det1-symbol.json"
URL: 
https://github.com/apache/incubator-mxnet/issues/5224#issuecomment-320858716
 
 
   @ysh329 i know it's too late~lol
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


  1   2   >