0

I am getting this error message

Error in mx.model.select.layout.train(X, y) : Cannot auto select array.layout, please specify this parameter

I am trying to create simple model to understand how things work

create data

train.x <- data.matrix(sample(1:100,1000,replace=T) )
colnames(train.x) <- "X"
train.y <- data.matrix(train.x^2)
colnames(train.y) <- "Y"

test.x = data.matrix(sample(1:100,50,replace=T) )
colnames(test.x) <- "X"
test.y <-data.matrix(test.x^2)
colnames(test.y) <- "Y"

test data

mx.set.seed(0)
model <- mx.mlp(train.x, train.y, hidden_node=10, out_node=2, 
out_activation="softmax",
num.round=20, array.batch.size=15, learning.rate=0.07, momentum=0.9,
eval.metric=mx.metric.accuracy)
Maraboc
  • 10,550
  • 3
  • 37
  • 48
Jim R
  • 1
  • 2

1 Answers1

0

It looks like you're trying to learn an approximation of of the function x --> x ^ 2. Your activation function shouldn't then be "softmax". That would be more appropriate for a classification problem. You could MSE (mean-squared error) or other loss functions more suited to a regression problem.

You might also find this MXNet/R tutorial helpful: https://mxnet.incubator.apache.org/tutorials/r/fiveMinutesNeuralNetwork.html