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 2019/10/31 16:08:17 UTC

[GitHub] [incubator-mxnet] roywei commented on a change in pull request #16676: [Estimator] handle composite metrics in estimator

roywei commented on a change in pull request #16676: [Estimator] handle composite metrics in estimator
URL: https://github.com/apache/incubator-mxnet/pull/16676#discussion_r341229529
 
 

 ##########
 File path: tests/nightly/estimator/test_sentiment_rnn.py
 ##########
 @@ -190,10 +190,11 @@ def run(net, train_dataloader, test_dataloader, num_epochs, ctx, lr):
     trainer = mx.gluon.Trainer(net.collect_params(), 'adam', {'learning_rate': lr})
     # Define loss and evaluation metrics
     loss = gluon.loss.SoftmaxCrossEntropyLoss()
-    acc = mx.metric.Accuracy()
+    metrics = mx.metric.CompositeEvalMetric()
+    metrics.add([mx.metric.Accuracy(), mx.metric.Loss()])
 
     # Define estimator
-    est = estimator.Estimator(net=net, loss=loss, metrics=acc,
+    est = estimator.Estimator(net=net, loss=loss, metrics=metrics,
 
 Review comment:
   we need to return metrics at the end, to test acc values after the run

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


With regards,
Apache Git Services