Closed ghost closed 8 years ago
have you looked at the documentation / vignettes?
Yes I have read it but have doubt in this section of the code
# convert to binary
X1 <- int2bin(X1)
X2 <- int2bin(X2)
Y <- int2bin(Y)
# Create 3d array: dim 1: samples; dim 2: time; dim 3: variables.
X <- array( c(X1,X2), dim=c(dim(X1),2) )
Y <- array( Y, dim=c(dim(Y),1) )
Is conversion to binary necessary? if yes cant it be automated that is can it be done in the background without the users intervention?.
And please forgive me if these are stupid questions but I am new to RNN itself?
No that is not necessary, this is just an example of the typical value of rnn over feed-forward nn (carrying the 1). But the point is that the inputs are combined into a single array, whether you turn it into binary or not.
sorry for the late reply;I have tried to convert input output variables into arrays
library(rnn)
x1=c(1:10)
x2=c(11:20)
y=x1+x2
x=cbind(x1,x2)
x=data.frame(x)
x=array( x, dim=c(dim(x1),2) )
y=array(y)
model=trainr(y,x)
but gets this error
Error in if (dim(X)[2] != dim(Y)[2]) { : missing value where TRUE/FALSE needed
I am sorry but this is not a help forum. You should post your question on stackoverflow. If you send me the link I will look at it there.
How can I use formula method with this package
but it returns this error