Hello. I am trying to repeat the example of implementing the
trainr function from
rnn package, shown on: https://cran.r-project.org/web/packages/rnn/rnn.pdf (p.15). I do this example with my own data, which can be found at: https://github.com/Maxim-ml/SP/blob/main/SP500.txt . This data is referred to as data in the text of code.
#Creating training numbers (variables) #S&P 500 SP500log_1<-diff(log(data[1:18429]))/2 SP500log_2<-diff(log(data[1:18429]))/2 #Create training response numbers (variables) SP500total<-SP500log_1 + SP500log_2 #Convert to binary SP500log_1<-int2bin(SP500log_1,length=8) SP500log_2<-int2bin(SP500log_2,length=8) SP500total<-int2bin(SP500total,length=8) #Create 3d array: dim 1:samples; dim 2:time; dim 3:variables SP_train_<-array(c(SP500log_1,SP500log_2), dim=c(dim(SP500log_1),2)) #Train the model SP500_model<-trainr( Y = SP500total, X = SP_train_, learningrate = 0.3, #learningrate_decay = 0, #momentum = 0, hidden_dim = 16, network_type = "lstm", numepochs = 50, #sigmoid = "tanh", #use_bias = TRUE, #batch_size = 128, #seq_to_seq_unsync = FALSE, #loss_function = "mse") summary(model)
However, when I run this code, I see only the red stop sign in the top of the console. The code itselt doesn't compile and I don't receive the result.I've been waiting for an hour already, but it's senseless. But when I run the example from p. 16 - 17 from the cran link above, everything actually goes well and compiles.
Could you, please, tell me, why the process of running the code doesn't come to its end? How is it possible to fix it and finish successfully?
Thank you for your effort.