pengxin99 commented on a change in pull request #12498: Code modification for  
testcases of various network models in directory example
URL: https://github.com/apache/incubator-mxnet/pull/12498#discussion_r235269821
 
 

 ##########
 File path: example/bayesian-methods/bdk_demo.py
 ##########
 @@ -180,18 +183,18 @@ def run_mnist_SGLD(training_num=50000):
     minibatch_size = 100
     net = get_mnist_sym()
     data_shape = (minibatch_size,) + X.shape[1::]
-    data_inputs = {'data': nd.zeros(data_shape, ctx=dev()),
-                   'softmax_label': nd.zeros((minibatch_size,), ctx=dev())}
+    data_inputs = {'data': nd.zeros(data_shape, ctx=dev(xpu)),
+                   'softmax_label': nd.zeros((minibatch_size,), ctx=dev(xpu))}
     initializer = mx.init.Xavier(factor_type="in", magnitude=2.34)
-    exe, sample_pool = SGLD(sym=net, dev=dev(), data_inputs=data_inputs, X=X, 
Y=Y,
+    exe, sample_pool = SGLD(sym=net, dev=dev(xpu), data_inputs=data_inputs, 
X=X, Y=Y,
                             X_test=X_test, Y_test=Y_test,
                             total_iter_num=1000000,
                             initializer=initializer,
                             learning_rate=4E-6, prior_precision=1.0, 
minibatch_size=100,
                             thin_interval=100, burn_in_iter_num=1000)
 
 
-def run_mnist_DistilledSGLD(training_num=50000):
+def run_mnist_DistilledSGLD(training_num=50000, xpu=0):
 
 Review comment:
   @sandeep-krishnamurthy  The code has been modified according to your 
requirements. Could you review it again? 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:
[email protected]


With regards,
Apache Git Services

Reply via email to