ReImproveJS icon indicating copy to clipboard operation
ReImproveJS copied to clipboard

confused about using model

Open Baael opened this issue 6 years ago • 1 comments

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.

Baael avatar Jul 12 '19 07:07 Baael

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

Pravez avatar Sep 17 '19 15:09 Pravez