cazala / synaptic

architecture-free neural network library for node.js and the browser
http://caza.la/synaptic
Other
6.92k stars 665 forks source link

What i should change to improve results #235

Open dfaustryjak opened 7 years ago

dfaustryjak commented 7 years ago

Hello I would like to predict stock price quotes Results: https://ibb.co/b2JDDQ Here is my configuration:

    var myNet = new Architect.Perceptron(6, 4,4, 1);
    var errors = []
    var result=[]
    var counter=0;

    var trainingOptions = {
        rate: .1,
        iterations: 20000,
        error: .005,
        log: 1,
        schedule: {
            every: 1,
            do: function (data) {
                errors.push(data.error);
                console.log(data.error)
                counter+=1;
                result.push({nr: counter, value: data.error});
            }
        }
    }

I don't know what i schould change... Here is chart of error https://ibb.co/fm01YQ

Input: close price mfi cci bop volume transactions

output close price [t+1]

wagenaartje commented 7 years ago

Just so you know: that is a fairly low error. And you don't have to user counter, as the data object contains a counter itself (data.iterations or data.iteration).

cazala commented 7 years ago

You could try using a LSTM instead of a Perceptron, they work better for sequence prediction since they have memory cells where they store information from previous activations.

cazala commented 7 years ago

like new Architect.LSTM(6, 5, 1), you could play a little bit changing the amount of memory blocks (the middle argument 5), but from my own experience, I would stick to only one layer of memory blocks (ie, not (6, 4, 4, 1) as your Perceptron setup) for the LSTM.

dfaustryjak commented 7 years ago

Ehh i also try LSTM but result is similar ... it's also weird situation that sometimes i have only one iteration and error equal 0.003...

dfaustryjak commented 7 years ago

I change output to: close price [t+1] close price [t+2] close price [t+3] and the results are simillar also ahh :P but the shape can told you when you schould buy 👍

dfaustryjak commented 7 years ago

It's better now :) I get only last results... https://ibb.co/caUqck