Reinforcement Learning

التعلم المعزز (RL)

Abbreviation: RL

Definition

A type of machine learning in which an agent learns to make decisions through trial and interaction with an environment so as to maximize the total reward.

Definition

Reinforcement learning is a paradigm of machine learning in which an agent learns to choose actions through trial-and-error interaction with an environment so as to maximise cumulative reward.

Practical examples

Code example Python
Q = {("s", "a"): 2.0, ("s2", "a"): 5.0, ("s2", "b"): 3.0}
alpha, gamma, r = 0.5, 0.9, 1.0

best_next = max(Q[("s2", x)] for x in ["a", "b"])
Q[("s", "a")] += alpha * (r + gamma * best_next - Q[("s", "a")])
print(Q[("s", "a")])

Expected output

3.75

Mathematical equations

Q(s,a) \leftarrow Q(s,a) + \alpha \big[\, r + \gamma \max_{a'} Q(s',a') - Q(s,a) \,\big]

Scientific sources

References and scientific sources

Learn and review

Suggested terms to learn next