The LSTM network is implemented with memory blocks containing one memory cell in each block. input layer is fully connected to the hidden layer. The weights for the network are randomly initialized. All the gates in a memory cell have bias values and they are initialized randomly and adjusted while training the network. Input vector for the network is the previous data points of the time series. Size of this input vector can be adjusted. The number of training timesteps to the future, the number of training iterations and the learning rate of the network can be adjusted accordingly.
int memCells = 5; // number of memory cells
int trainDataSize = 300; // train data size
int inputVecSize = 60; // input vector size
int timeSteps = 60; // unfolded time steps
float learningRate = 0.02; // leraning rate
int predictions = 1300; // prediction points
int iterations = 10; // training iterations with training data
LSTMNet lstm(memCells,inputVecSize);
lstm.train(input, targetVector, trainDataSize, timeSteps, learningRate, iterations);
double result;
result = lstm.predict(input);