You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/21 19:14:20 UTC
[GitHub] sandeep-krishnamurthy commented on a change in pull request #12498:
Code modification for testcases of various network models in directory
example
sandeep-krishnamurthy 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_r226874463
##########
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:
This means, by default, mx.gpu(0). Should it default to CPU instead by making xpu=None?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services