BeTomorrow / ReImproveJS

A framework using TensorFlow.js for Deep Reinforcement Learning
MIT License
123 stars 16 forks source link

confused about using model #16

Open Baael opened 5 years ago

Baael commented 5 years ago

Hello! Really nice library, thank you! I am bit confused, I've trained model with good results, saved it to file and now I would like to use with model.predict in "plain" tensorflow.js or even something like agent.predict. How can I do that? I am new to tensorflow.js, tried multiple options, always getting errors that shape is different than expected on tensor2d contruction.

Thank you for your help.

Pravez commented 4 years ago

Hi ! Sorry for the delay. For what I understood, you want to use the model trained with ReimproveJS in a plain tensorflow.js environment, without the library.

The problem must be the size of your input. Indeed the neural network in ReimproveJS is taking as input the current state plus a specified quantity of previous states and previous taken actions. By default it is set to 1. So for instance if your state is of size 5 and your actions is of size 1, then the size of the input will be of 5+5+1, so 11.

Hope this helps