+1 vote
in Artificial Intelligence by
How does Reinforcement Learning work? Explain with an example.

1 Answer

0 votes
by

The environment is the setting that the agent is acting on and the agent represents the RL algorithm.

The RL process starts when the environment sends a state to the agent, which then based on its observations, takes an action in response to that state.

In turn, the environment sends the next state and the respective reward back to the agent. The agent will update its knowledge with the reward returned by the environment to evaluate its last action.

The loop continues until the environment sends a terminal state, which means the agent has accomplished all his tasks.

To understand this better, let’s suppose that our agent is learning to play counterstrike. The RL process can be broken down into the below steps:

  • The RL Agent (Player1) collects state S° from the environment (Counterstrike game)
  • Based on the state S°, the RL agent takes an action A°, (Action can be anything that causes a result i.e. if the agent moves left or right in the game). Initially, the action is random
  • The environment is now in a new state S¹ (new stage in the game)
  • The RL agent now gets a reward R¹ from the environment. This reward can be additional points or coins
  • This RL loop goes on until the RL agent is dead or reaches the destination, and it continuously outputs a sequence of state, action, and reward.

...