model <- mx.model.FeedForward.create(softmax, X=train.x, y=train.y, ctx=devices, num.round=3000, array.batch.size=100, learning.rate=0.03, momentum=0.99, eval.metric=mx.metric.accuracy, initializer=mx.init.uniform(0.5), array.layout = "rowmajor", epoch.end.callback=mx.callback.log.train.metric(100)) preds <- predict(model, test, array.layout = "rowmajor") pred.label <- max.col(t(preds)) - 1