BeTomorrow / ReImproveJS

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

Example/Documentation update [TFJS expected axis NaN for dense1] #2

Closed carlos-r-l-rodrigues closed 6 years ago

carlos-r-l-rodrigues commented 6 years ago

It seems that the model must goes inside the Agent config: model.compile({loss: 'categoricalCrossentropy', optimizer: 'sgd'}) const agentConfig = { model: model, memorySize: 5000, batchSize: 128, temporalWindow: temporalWindow };

await academy.step([ {teacherName: teacher, inputs: inputs} ]); The parameters in the interface AcademyStepInput are "teacherName" and "agentsInput".

Pravez commented 6 years ago

Indeed, thank you for noticing it ! Corrected.

carlos-r-l-rodrigues commented 6 years ago

The model should be like this: const agentConfig = { model: model, agentConfig: { memorySize: 1000, batchSize: 10, temporalWindow: temporalWindow } };

Also, the academy.step should be: await academy.step([ { teacherName: teacher, agentsInput: inputs } ])

I'm also debugging another issue with tensorflow.js but I haven't figured out why it's happen. Error: Input 0 is incompatible with layer dense_Dense1: expected axis NaN of input shape to have value

Pravez commented 6 years ago

Thank you once more, I forgot the second part of the correction...

Can you provide an example to reproduce your bug ?

carlos-r-l-rodrigues commented 6 years ago

Please ignore the error, it was caused by another third part code overriding the Object.prototype.clone. At some point it was changing the type of the objects used by ts.js and failing in the assert.

Thanks for this awesome framework 👍