Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example request for QLearning #3

Open
Feiko opened this issue Jul 3, 2019 · 2 comments
Open

Example request for QLearning #3

Feiko opened this issue Jul 3, 2019 · 2 comments

Comments

@Feiko
Copy link

Feiko commented Jul 3, 2019

Could you please add an example on how to train and implement QLearning? I find this a very interesting feature.

@jczic
Copy link
Owner

jczic commented Jul 4, 2019

Hello,
I don't have an example now but you must use the "QLearningLearnForChosenAction" function to learn a new step in the current environment for an action performed.
"stateVectorNNValues" is the values of the environment now and "pastStateVectorNNValues", the values of the environment before the action.
The network must have as many output neurons as possible actions and "chosenActionIndex" is the index of the output action neuron selected.
You can check https://en.wikipedia.org/wiki/Q-learning to fast understand the logic of QLearning.

@jrmoserbaltimore
Copy link

jrmoserbaltimore commented Mar 26, 2021

Is this suitable for reducing error on input vectors? e.g. if I have 4 (3 state, 1 error) inputs and 3 outputs, and from the outputs I take an action that then causes the error to increase or decrease, can I pass back to it the new error state or the change in error state and have it learn that what it did made things better/worse?

I'm trying to do this with a loop with xor.py:

  • Predict for random pair of booleans
  • Compute the XOR of those two booleans
  • Tell it that in prior state it predicted correctly/incorrectly

But more I'm interested in auto-tuning, i.e. you have a sensor input X, adjust the PWM to a heater and then come back and determine if the error increased or decreased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants