Skip to content

Instantly share code, notes, and snippets.

@HackerEarthBlog
Last active January 31, 2017 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HackerEarthBlog/c59c28391315ed420d24d14068fbc9ca to your computer and use it in GitHub Desktop.
Save HackerEarthBlog/c59c28391315ed420d24d14068fbc9ca to your computer and use it in GitHub Desktop.
#set seed to reproduce results
mx.set.seed(1)
mlpmodel <- mx.mlp(data = train.x
,label = train.y
,hidden_node = 3 #one layer with 10 nodes
,out_node = 2
,out_activation = "softmax" #softmax return probability
,num.round = 100 #number of iterations over training data
,array.batch.size = 20 #after every batch weights will get updated
,learning.rate = 0.03 #same as step size
,eval.metric= mx.metric.accuracy
,eval.data = list(data = test.x, label = test.y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment