Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How do i have to adapt the predict function in @arthurratz example TensorFlow.js: Predicting Time Series Using Recurrent Neural Networks (RNN) With Long Short-Term Memory (LSTM) Cells[^] that i will predict the n+1 window?

So far i understand that the algorithm starts predicting, depending on the size of the .slice(), and determines sma values.

How can we get "future" values, beyond the last calculated sma?

What I have tried:

So far i have analized the parameters on the console.log. Te function is the following

function Predict(inputs, size, model) 
{
    var inps = inputs.slice(Math.floor(size / 100 * inputs.length), inputs.length);

    const outps = model.predict(tf.tensor2d(inps, [inps.length, 
	inps[0].length]).div(tf.scalar(10))).mul(10);

    return Array.from(outps.dataSync());
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900