I am trying to use a RNN in MXNet to do a classification. My data roughly looks like the matrices m0 and m1 I created. m0 represents e.g. energy consumption of a device over time, while m1 is my label to tell how the device is to be classified (e.g. binary in this case). My goal is to detect the category of a device by looking at the energy consumption over time. I keep getting errors about a shape mismatch and can't find a solution by changing input parameters. You can see my code and error messages below. I appreciate any suggestions on how to handle this problem.
require(mxnet)
m0 <- matrix(runif(200*100), 100, 200)
m1 <- matrix(round(runif(1*200)), 1, 200)
num.round <- 10
update.period <- 1
num.rnn.layer <- 1
seq.len <- 100
num.hidden <- 1
num.embed <- 1
num.label <- 1
batch.size <- 1
input.size <- 1
learning.rate <- 0.1
X.train <- list(data = m0, label = m1)
model <- mx.rnn(train.data = X.train,
eval.data = NULL,
num.rnn.layer = num.rnn.layer,
seq.len = seq.len,
num.hidden = num.hidden,
num.embed = num.embed,
num.label = num.label,
batch.size = batch.size,
input.size = input.size,
ctx = mx.cpu(),
num.round = num.round,
update.period = update.period,
initializer = mx.init.uniform(0.1),
learning.rate = learning.rate)
[16:07:02] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\src\operator\tensor./matrix_op-inl.h:144: Using target_shape will be deprecated.
[16:07:02] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\src\operator\tensor./matrix_op-inl.h:144: Using target_shape will be deprecated.
[16:07:02] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\src\operator\tensor./matrix_op-inl.h:144: Using target_shape will be deprecated.
[16:07:02] D:\Program Files (x86)\Jenkins\workspace\mxnet\mxnet\dmlc-core\include\dmlc/logging.h:304:
[16:07:02] D:\Program Files (x86)\Jenkins\workspace\mxnet\mxnet\src\ndarray\ndarray.cc:299: Check failed: from.shape() == to->shape() operands shape mismatchfrom.shape=(1,1) to.shape=(1,100) Error in exec$update.arg.arrays(arg.arrays, match.name, skip.null):
[16:07:02] D:\Program Files (x86)\Jenkins\workspace\mxnet\mxnet\src\ndarray\ndarray.cc:299: Check failed: from.shape() == to->shape() operands shape mismatchfrom.shape=(1,1) to.shape=(1,100)