Answers.Body: <p>What you are looking for is called &quot;reinforcement learning&quot;.</p>
  <p>A reinforcement learning algorithm will try to maximize a reward function. This reward represents how &quot;good&quot; or &quot;bad&quot; an action is in the actual context. For example, in the snake game, your reward will be positive for eating an apple and negative when the snake hits a wall.</p>
  <p>The interesting thing is that, with reinforcement learning, you can learn without having a reward at each step. In the case of the snake game, your agent can learn that going in the direction of the apple is better than going in the direction of the wall, even if none of this action will directly give a reward (positive or negative).</p>
  <p>If you want to use a neural network as your post seem to imply then you should look at deep Q-learning, a reinforcement learning algorithm, which use a neural network to learn to predict the expected reward of a couple (state, action).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-11T13:56:12.720Z
Answers.Text: I agree and also think the OP is looking for RL. It is worth noting in the answer that the neural network can only be *part* of the RL algorithm. You cannot write a neural network that "does RL" using e.g. Keras. The OP will want to learn the general approach and structure for RL first. A good starting method might be Q-learning and DQN for how neural networks fit it.
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-11T17:14:16.800Z
Answers.Text: Perfect! Thank you. The terms I was googling were just not giving me "reinforcement learning" haha. I've heard the name many times but just didn't realize that is what it was called.
Answers.UserDisplayName: Kyle Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-11T17:16:54.890Z
Answers.Text: @NeilSlater I'm starting to write a DQN following the Keras examples for an actor and critic now. So far it's pretty unique compared to what I'm used to but this seems like a great topic to learn next.
Answers.UserDisplayName: Kyle Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-11T13:48:35.450Z
Answers.LastActivityDate: 2021-02-11T18:53:47.877Z
Answers.LastEditDate: 2021-02-11T18:53:47.877Z
Answers.UserDisplayName: kirua
Body: <p>I'm trying to find the name for a model that is used to output a decision (maybe something like <code>right</code>, <code>left</code>, or <code>do nothing</code> = <code>-1</code>, <code>0</code>,<code>1</code>) but that can be trained with labels that contain how &quot;correct&quot; or &quot;incorrect&quot; it was. I've tried to google around and ask some friends in my machine learning class, but no one seems to have an answer.</p>
  <p>The classic example I seem to always see is the models used in the snake game. We don't know what the right decision was per se, but we can say that if it ran into the wall, that was really wrong. Or if it got an apple and gained 50 points, then it was correct and if it got 2 apples and gained 100 points then it was even more correct, etc.</p>
  <p>I'm looking for a network where the exact labels don't exist, but where we can penalize or reward its decisions.</p>
  <p>I'm assuming this requires some kind of modified cost function, but I would imagine this type of network already exists. I'm hoping someone can provide me with the name for this type of network and whether or not there is a Keras frontend for something like this.</p>
  
Tags: <machine-learning><reinforcement-learning><tensorflow><deep-rl><models>
Title: Is there a machine learning model that can be trained with labels that only say how "right" or "wrong" it was?
UserDisplayName: Kyle Dixon
ThreadText: # Is there a machine learning model that can be trained with labels that only say how "right" or "wrong" it was?
  
  (Asked by: username_0 on 2021-02-11)
  
  I'm trying to find the name for a model that is used to output a decision (maybe something like `right`, `left`, or `do nothing` = `-1`, `0`,`1`) but that can be trained with labels that contain how "correct" or "incorrect" it was. I've tried to google around and ask some friends in my machine learning class, but no one seems to have an answer.
  
  The classic example I seem to always see is the models used in the snake game. We don't know what the right decision was per se, but we can say that if it ran into the wall, that was really wrong. Or if it got an apple and gained 50 points, then it was correct and if it got 2 apples and gained 100 points then it was even more correct, etc.
  
  I'm looking for a network where the exact labels don't exist, but where we can penalize or reward its decisions.
  
  I'm assuming this requires some kind of modified cost function, but I would imagine this type of network already exists. I'm hoping someone can provide me with the name for this type of network and whether or not there is a Keras frontend for something like this.
  
  **Tags:** machine-learning, reinforcement-learning, tensorflow, deep-rl, models
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-02-11. Score: 13 | Accepted answer
  
  What you are looking for is called "reinforcement learning".
  
  A reinforcement learning algorithm will try to maximize a reward function. This reward represents how "good" or "bad" an action is in the actual context. For example, in the snake game, your reward will be positive for eating an apple and negative when the snake hits a wall.
  
  The interesting thing is that, with reinforcement learning, you can learn without having a reward at each step. In the case of the snake game, your agent can learn that going in the direction of the apple is better than going in the direction of the wall, even if none of this action will directly give a reward (positive or negative).
  
  If you want to use a neural network as your post seem to imply then you should look at deep Q-learning, a reinforcement learning algorithm, which use a neural network to learn to predict the expected reward of a couple (state, action).
  
  > **Comments:**
  > **username_2**: I agree and also think the OP is looking for RL. It is worth noting in the answer that the neural network can only be *part* of the RL algorithm. You cannot write a neural network that "does RL" using e.g. Keras. The OP will want to learn the general approach and structure for RL first. A good starting method might be Q-learning and DQN for how neural networks fit it.  
  > **username_0**: Perfect! Thank you. The terms I was googling were just not giving me "reinforcement learning" haha. I've heard the name many times but just didn't realize that is what it was called.  
  > **username_0**: @NeilSlater I'm starting to write a DQN following the Keras examples for an actor and critic now. So far it's pretty unique compared to what I'm used to but this seems like a great topic to learn next.  
  
  ---
  
  