mbithy / Trevel

The smartest Bitcoin Gambling bot for freebitco.in.
88 stars 56 forks source link

Loading Saved Networks #12

Closed zippynl closed 6 years ago

zippynl commented 6 years ago

Great stuff with the wiki! but 1 thing is not clear.

What do you mean with this: Make sure that your var spec = {} match what you trained with Do you have a example what it could be?

And this. When i copy the DQ-Trevel.js in the console and i do the var netString='copy paste your network model here'; var netObject=JSON.parse(netString); agent.fromJSON(netObject); with the trained network code paste {"W1":{"n":10,"d":24,"w":{"0":0.00239 etc 626654111294}}} it gives the error Uncaught SyntaxError: Unexpected token o in JSON at position 1 at JSON.parse () at :2:20

What am i doing wrong?

mbithy commented 6 years ago

see what @osavigne suggested and make sure you don't include double quotes " in between the ' single quotes at the start b4 the first { and after the last } var spec is the variable spec in DQ-Trevel its noted in the comments

//if you are loading a trainned network the values here should match your trainning values
spec.epsilon = 0.20;
spec.alpha = 0.1;
spec.experience_add_every = 5;
spec.experience_size = 999999;
spec.learning_steps_per_iteration = 5;
spec.tderror_clamp = 1.0; 
spec.num_hidden_units = 100;
zippynl commented 6 years ago

So i did it like this(i took code from the middle so its not that long: var netString='{"nh":100,"ns":5,"na":2,"net":{"W1":{"n":100,"d":5,"w":{"0":-0.19900864127143897,"1":-0.061143301242088915,"2":-0.5012762985210412,"3":-0.05593718023682009,"4":0.009160040719231417,"5":,"199":0.19622962316565892}},"b2":{"n":2,"d":1,"w":{"0":0.10431418654902055,"1":0.13216833544777085}}}}'; var netObject=JSON.parse(netString); agent.fromJSON(netObject);

And then it gave a "undefined". Did i do it correct?

zippynl commented 6 years ago

@osavigne yes i have skype, add me zippy_nl