10-20-2019, 08:42 PM
(10-07-2019, 09:12 AM)Dieguz Wrote: Hello,
for information : you can find different NN strategies here.
[url= https://www.reddit.com/r/algotrading/com...with/]link for NN strats comparison[/url]
one of the best commented code is neuralNetcode
Maily they use convnetjs as framework.
We don't know the code used by Lenny and the relative framework.
Diego
Actually on the tensorflow website there is allready a simple helloworld examlple.
Its not at all doing trades but from here its easy to write something (well it is for me), but anyway besides the network design and inputs and train method.. its a basic neural net. (an install for node cpu (
Code:
npm install @tensorflow/tfjs-node
) is here https://www.tensorflow.org/js/tutorials/setup )
const tf = require('@tensorflow/tfjs');
// Optional Load the binding:
// Use '@tensorflow/tfjs-node-gpu' if running with GPU.
require('@tensorflow/tfjs-node');
// Train a simple model:
const model = tf.sequential();
model.add(tf.layers.dense({units: 100, activation: 'relu', inputShape: [10]}));
model.add(tf.layers.dense({units: 1, activation: 'linear'}));
model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});
const xs = tf.randomNormal([100, 10]);
const ys = tf.randomNormal([100, 1]);
model.fit(xs, ys, {
epochs: 100,
callbacks: {
onEpochEnd: (epoch, log) => console.log(`Epoch ${epoch}: loss = ${log.loss}`)
}
});
[....Resistance is futile...]