bquast / rnn

Recurrent Neural Networks in R
https://qua.st/rnn
73 stars 28 forks source link

Epoch error #22

Closed KeyvanSadri closed 7 years ago

KeyvanSadri commented 7 years ago

I get an Epoch error when I run the example code for trainr in the manual:

Not run:

create training numbers

X1 = sample(0:127, 7000, replace=TRUE) X2 = sample(0:127, 7000, replace=TRUE)

create training response numbers

Y <- X1 + X2

convert to binary

X1 <- int2bin(X1, length=8) X2 <- int2bin(X2, length=8) Y <- int2bin(Y, length=8)

create 3d array: dim 1: samples; dim 2: time; dim 3: variables

X <- array( c(X1,X2), dim=c(dim(X1),2) )

train the model

model <- trainr(Y=Y, X=X, learningrate = 0.1, hidden_dim = 10 )

bquast commented 7 years ago

exactly as should be