Reinforcement Learning
Reinforcement Learning: the program learns from consequences of its actions (reward or punishment), rather than from being explicitly taught and selects its actions on basis of its past experiences (exploitation) and also by new choices (exploration).
Link to original
Summary of RL
An agent occupies a given state at any given time. An action moves the agent from one state to another. In RL, there is no human interaction. The agent is placed into an environment and is given a goal to learn how to behave in the environment by trial and error using feedback from its own actions and experiences.
The agent needs to know that something good or bad has happened, this kind of feedback is called a reward or reinforcement.
Characteristics of RL:
- goal-oriented learning
- interaction with an uncertain environment
- learning how to map situations to actions to maximise numerical reward signal
- learner is not told which actions to take
- trial and error search
- possibility of delayed reward
- exploration vs. exploitation
RL works with evaluative feedback which says how good the action was and not whether it was the best thing to do (instruction feedback).
Associative learning maps inputs to outputs and learns best output for each input, while non-associative learns the one best output.
-armed bandits
-armed bandits is a situation where:
- We have actions to choose from, where reward probabilities are not known.
- Our goal is to maximise the total reward in the long run.
We can take the following approach:
- Choose repeatedly from one of actions. (each choice is called a play)
- Action values: after each play , you get a reward , where
- Distribution of depends only on .
- Our objective is to maximise reward in long term, so to solve the -armed bandit problem, we must explore a variety of options and then exploit the best of them.
Exploration vs. exploitation
Suppose we form action value estimates (what each action is worth at each point in time) Given we maintain a estimate for every , then there is (at least) one action whose estimated value is greatest at any time step (greedy).
The greedy action at is: Picking is exploitation, any other value is exploration. Exploitation will maximise the expected reward on one step but exploration may produce the greater total reward in the long run. We cannot do both at the same time. Exploration is generally infinite but we should eventually reduce exploring.
Action-value methods
“Sample-average” method: maintain a list of all rewards received and average them for each action
- If by the -th play, action has been chosen times prior to , yielding :
- If , then set to some default value, e.g. .
- If we update often enough, the estimate of the value of each action will converge to the actual value of the action.
- However, this method uses too much memory, so we use an incremental implementation.
Incremental implementation: if is the average of the first rewards and is the reward, then
-greedy gives us a way to balance exploration-exploitation.
- Pick
- -greedy action selection:
- Most of the time we are greedy, but explore sometimes. This is the simplest way to try to balance exploration and exploitation.