Ошибка в mx.io.internal.arrayiter (as.array (данные), as.array (метка), unif.rnds,: несовместимо с запрошенным типом: [type = list; target = double] - PullRequest
0 голосов
/ 19 мая 2019

Я пытаюсь обучить модель классификации с использованием пакета "mxnet"

train_matrix.x <- train_matrix[,-92]
train_matrix.y <- train_matrix[,92]

# normalize 
train_matrix.x <- t(lapply(train_matrix.x , normalize)) 
test_matrix <- t(lapply(test_matrix , normalize))

# check the distribution of the classes
table(train_matrix.y)
## Network Configuration
data <- mx.symbol.Variable("data")
fc1 <- mx.symbol.FullyConnected(data, name="fc1", num_hidden=10)
act1 <- mx.symbol.Activation(fc1, name="relu1", act_type="relu")
fc2 <- mx.symbol.FullyConnected(act1, name="fc2", num_hidden=10)
devices <- mx.cpu()

# train the model
mx.set.seed(0)
model <- mx.model.FeedForward.create(array.layout = "colmajor", softmax, X=data.matrix(train_matrix.x), y=array(train_matrix.y),
                                     ctx=devices, num.round=10, array.batch.size=100,
                                     learning.rate=0.07, momentum=0.9, eval.metric=mx.metric.accuracy,
                                     initializer=mx.init.uniform(0.07),
                                     epoch.end.callback=mx.callback.log.train.metric(100))

Но я продолжаю получать эту ошибку:

 Error in mx.io.internal.arrayiter(as.array(data), as.array(label), unif.rnds,  : 
  Not compatible with requested type: [type=list; target=double].

Так как я новичок в углубленном изучении кодированияЯ не мог понять, что случилось.Заранее спасибо

...