--
You received this message because you are subscribed to a topic in the Google Groups "convnetjs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/convnetjs/QMbTOdhsnRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to convnetjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm not a programmer however I'm learning the concepts slowly,
I have attached a sample on what I think the code should look like,
I have highlighted in yellow variation, any further assistance would be appreciated
Sample High Low close Date GBPUSD
Date |
Open |
High |
Low |
Close |
Volume |
|
1993.05.12 |
00:00 |
1.537 |
1.5445 |
1.529 |
1.5338 |
2781 |
1993.05.13 |
00:00 |
1.5328 |
1.536 |
1.518 |
1.5225 |
2571 |
1993.05.14 |
00:00 |
1.5228 |
1.5415 |
1.52 |
1.5387 |
2711 |
1993.05.17 |
00:00 |
1.5365 |
1.546 |
1.5309 |
1.5355 |
2921 |
1993.05.18 |
00:00 |
1.535 |
1.538 |
1.5237 |
1.5365 |
2711 |
1993.05.19 |
00:00 |
1.535 |
1.5482 |
1.5328 |
1.5432 |
2261 |
1993.05.20 |
00:00 |
1.5425 |
1.5603 |
1.5383 |
1.5565 |
3001 |
1993.05.21 |
00:00 |
1.5548 |
1.5592 |
1.539 |
1.5425 |
2811 |
1993.05.24 |
00:00 |
1.54 |
1.545 |
1.5289 |
1.5365 |
2871 |
1993.05.25 |
00:00 |
1.5385 |
1.547 |
1.5345 |
1.542 |
2151 |
1993.05.26 |
00:00 |
1.542 |
1.5505 |
1.541 |
1.5472 |
1381 |
1993.05.27 |
00:00 |
1.5453 |
1.565 |
1.5425 |
1.562 |
2831 |
1993.05.28 |
00:00 |
1.561 |
1.568 |
1.5535 |
1.5607 |
2871 |
1993.05.31 |
00:00 |
1.5605 |
1.563 |
1.556 |
1.561 |
1351 |
1993.06.01 |
00:00 |
1.5613 |
1.567 |
1.546 |
1.5555 |
3621 |
1993.06.02 |
00:00 |
1.5544 |
1.556 |
1.5364 |
1.54 |
2481 |
1993.06.03 |
00:00 |
1.5403 |
1.5501 |
1.537 |
1.5501 |
1641 |
1993.06.04 |
00:00 |
1.549 |
1.5505 |
1.506 |
1.5085 |
4851 |
1993.06.07 |
00:00 |
1.5063 |
1.5268 |
1.506 |
1.5268 |
2111 |
1993.06.08 |
00:00 |
1.5253 |
1.5265 |
1.5135 |
1.5205 |
2121 |
1993.06.09 |
00:00 |
1.5195 |
1.527 |
1.5069 |
1.5152 |
3591 |
1993.06.10 |
00:00 |
1.5137 |
1.5325 |
1.507 |
1.5305 |
3421 |
1993.06.11 |
00:00 |
1.5293 |
1.5405 |
1.5185 |
1.5215 |
3621 |
1993.06.14 |
00:00 |
1.519 |
1.533 |
1.519 |
1.5285 |
1851 |
1993.06.15 |
00:00 |
1.5275 |
1.5355 |
1.514 |
1.5165 |
3201 |
Using code from ConvetJs Sample
I have highlighted in Yellow the possible variation we can use for project this is just for illustration, the original code untouched as used reference
https://cs.stanford.edu/people/karpathy/convnetjs/demo/rldemo.html
var num_inputs = 27; // 9 eyes, each sees 3 numbers (wall, green, red thing proximity)
var num_inputs = 6; // Date,Open High Low Close Volume
var num_actions = 5; // 5 possible angles agent can turn
var num_actions = 3; // (Buy Open Exit Close), ( Sell Open Exit Close), ( Do Nothing)
var temporal_window = 1; // amount of temporal memory. 0 = agent lives in-the-moment :)
var temporal_window = 1; // amount of temporal memory. 0 = agent lives in-the-moment :) Not sure how this would integrate with out systems
var network_size = num_inputs*temporal_window + num_actions*temporal_window + num_inputs;
var network_size = num_inputs*temporal_window + num_actions*temporal_window + num_inputs;
// the value function network computes a value of taking any of the possible actions
// given an input state. Here we specify one explicitly the hard way
// but user could also equivalently instead use opt.hidden_layer_sizes = [20,20]
// to just insert simple relu hidden layers.
var layer_defs = [];
layer_defs.push({type:'input', out_sx:1, out_sy:1, out_depth:network_size});
layer_defs.push({type:'fc', num_neurons: 50, activation:'relu'});
layer_defs.push({type:'fc', num_neurons: 50, activation:'relu'});
layer_defs.push({type:'regression', num_neurons:num_actions});
// options for the Temporal Difference learner that trains the above net
// by backpropping the temporal difference learning rule.
var tdtrainer_options = {learning_rate:0.001, momentum:0.0, batch_size:64, l2_decay:0.01};
var opt = {};
opt.temporal_window = temporal_window;
opt.experience_size = 30000;
opt.start_learn_threshold = 1000;
opt.gamma = 0.7;
opt.learning_steps_total = 200000;
opt.learning_steps_burnin = 3000;
opt.epsilon_min = 0.05;
opt.epsilon_test_time = 0.05;
opt.layer_defs = layer_defs;
opt.tdtrainer_options = tdtrainer_options;
var brain = new deepqlearn.Brain(num_inputs, num_actions, opt); // woohoo
It's very simple to use deeqlearn.Brain: Initialize your network:
var brain = new deepqlearn.Brain(num_inputs, num_actions);
And to train it proceed in loops as follows:
var action = brain.forward(array_with_num_inputs_numbers);
// action is a number in [0, num_actions) telling index of the action the agent chooses
// here, apply the action on environment and observe some reward. Finally, communicate it:
brain.backward(reward); // <-- learning magic happens here
brain.backward(reward); // <-- learning magic happens here maximum pips overtime
That's it! Let the agent learn over time (it will take opt.learning_steps_total), and it will only get better and better at accumulating reward as it learns. Note that the agent will still take random actions with probability opt.epsilon_min even once it's fully trained. To completely disable this randomness, or change it, you can disable the learning and set epsilon_test_time to 0:
brain.epsilon_test_time = 0.0; // don't make any random choices, ever
brain.learning = false;
var action = brain.forward(array_with_num_inputs_numbers); // get optimal action from learned policy
PeterThanks
...
--
You received this message because you are subscribed to the Google Groups "convnetjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to convnetjs+...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "convnetjs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/convnetjs/QMbTOdhsnRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to convnetjs+...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "convnetjs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/convnetjs/QMbTOdhsnRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to convnetjs+...@googlegroups.com.
Hi
The calculations is taken for the previous bar data for next bar action
On the next open algo would either Buy open exit close, sell open, exit close or do nothing
Hope make sense
Peter
But if i'm not mistaken, this means in turn, that it's not doable in real life: if you make the decision at the start of the bar/time slot then you can't have the high/low in the input; if you make the decision at the end of the time slot, then you can't realize the reward from that slot. I may be missing something. Can you explain along those lines? Thanks
--
You received this message because you are subscribed to the Google Groups "convnetjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to convnetjs+...@googlegroups.com.