I'm trying to setup a LSTM RNN by using mxnet in R, however, while trying to train my network I get this error and R is showing me a fatal error all the time: "[00:36:08] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\src\operator\tensor./matrix_op-inl.h:155: Using target_shape will be deprecated. [00:36:08] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\src\operator\tensor./matrix_op-inl.h:155: Using target_shape will be deprecated. [00:36:08] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\src\operator\tensor./matrix_op-inl.h:155: Using target_shape will be deprecated."
here is my code:
# install.packages("drat", repos="https://cran.rstudio.com")
# drat:::addRepo("dmlc")
# install.packages("mxnet")
rm(list = ls())
require(mxnet)
require(mlbench)
inputData <- read.table(file.path(getwd(), "Data", "input.csv"),
header = TRUE, sep = ",")
inputData$X <- as.Date(inputData$X)
inputData <- na.omit(inputData)
index <- 1:nrow(inputData)*0.8
train.dates <- inputData[index,1]
test.dates <- inputData[-index,1]
inputData[,1] <- NULL
train <- inputData[index,]
test <- inputData[-index,]
train.x <- data.matrix(train[,-ncol(train)])
test.x <- data.matrix(test[,-ncol(test)])
train.y <- train[,ncol(train)]
test.y <- test[,ncol(test)]
get.label <- function(X) {
label <- array(0, dim=dim(X))
d <- dim(X)[1]
w <- dim(X)[2]
for (i in 0:(w-1)) {
for (j in 1:d) {
label[i*d+j] <- X[(i*d+j)%%(w*d)+1]
}
}
return (label)
}
X.train.label <- get.label(t(train.x))
X.val.label <- get.label(t(test.x))
X.train <- list(data=t(train.x), label=X.train.label)
X.val <- list(data=t(test.x), label=X.val.label)
batch.size = 1
seq.len = 32
num.hidden = 16
num.embed = 16
num.lstm.layer = 1
num.round = 1
learning.rate= 0.1
wd=0.00001
clip_gradient=1
update.period = 1
model <- mx.lstm(X.train, X.val,
ctx=mx.cpu(),
num.round=num.round,
update.period=update.period,
num.lstm.layer=num.lstm.layer,
seq.len=seq.len,
num.hidden=num.hidden,
num.embed=num.embed,
num.label=15,
batch.size=batch.size,
input.size=15,
initializer=mx.init.uniform(0.1),
learning.rate=learning.rate,
wd=wd,
clip_gradient=clip_gradient)
Input dataset consists of Date column, 15 features, and the target value. Please hep me. Thanks in advance!