Click here to Skip to main content
14,270,386 members
Rate this:
Please Sign up or sign in to vote.
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100