Showing posts with label action value function. Show all posts
Showing posts with label action value function. Show all posts

Thursday, October 24, 2024

Value Function Methods in Reinforcement Learning


Value Function in Reinforcement Learning (RL) – Complete Guide

๐ŸŽฏ Value Function in Reinforcement Learning (RL): Complete Deep Dive

๐Ÿ“š Table of Contents

๐Ÿ“˜ Introduction

Reinforcement Learning (RL) is one of the most powerful paradigms in artificial intelligence. It focuses on how agents make decisions by interacting with an environment.

At the core of this decision-making lies the value function — a concept that enables agents to predict the future and act intelligently.

๐Ÿ’ก Key Insight: RL is not about immediate reward — it’s about maximizing long-term cumulative reward.

๐Ÿง  What is a Value Function?

A value function estimates how good a situation is for an agent.

1. State Value Function

$$ V(s) = \mathbb{E}[G_t | S_t = s] $$

This represents expected future reward starting from state s.

2. Action Value Function

$$ Q(s,a) = \mathbb{E}[G_t | S_t = s, A_t = a] $$

This evaluates how good taking action a in state s is.

✔ V(s) → “How good is this state?” ✔ Q(s,a) → “How good is this action in this state?”

⚙️ How Value Functions Work

Agents repeatedly interact with the environment:

  • Observe state
  • Take action
  • Receive reward
  • Move to next state

๐Ÿ“Š Return Definition

$$ G_t = R_{t+1} + \gamma R_{t+2} + \gamma^2 R_{t+3} + ... $$

This equation represents cumulative reward.

๐Ÿ” Discount Factor

$$ 0 \leq \gamma \leq 1 $$

  • ฮณ = 0 → only immediate rewards matter
  • ฮณ → 1 → future rewards matter more

๐Ÿ“ Bellman Equations Explained

State Value Bellman Equation

$$ V(s) = \sum_a \pi(a|s) \sum_{s'} P(s'|s,a) [R + \gamma V(s')] $$

Action Value Bellman Equation

$$ Q(s,a) = \sum_{s'} P(s'|s,a) [R + \gamma \max_{a'} Q(s',a')] $$

These equations break a complex decision into smaller recursive problems.

๐Ÿ’ก Bellman Equation = “Future reward = immediate reward + discounted future value”

๐Ÿงฉ Value Function-Based Methods

๐Ÿ”„ Value Iteration

Initialize V(s) = 0
Repeat:
  V(s) = max_a ฮฃ P(s'|s,a)[R + ฮณV(s')]
Until convergence
Iteration 1: V(s)=0
Iteration 2: V(s)=5.3
Iteration 3: V(s)=6.1
...
Converged

๐Ÿ” Policy Iteration

Initialize random policy ฯ€
Repeat:
  Evaluate Vฯ€
  Improve policy:
    ฯ€(s) = argmax Q(s,a)
Until stable

๐ŸŒ Applications

  • Robotics – navigation & automation
  • Game AI – chess, Go
  • Finance – trading optimization
  • Healthcare – treatment planning

⚠️ Challenges

๐Ÿ“‰ Curse of Dimensionality

State space grows exponentially:

$$ |S| = n^d $$

Where:

  • n = possible values
  • d = dimensions

๐Ÿง  Function Approximation

Neural networks approximate value functions:

$$ V(s; \theta) $$

๐ŸŽฏ Conclusion

✔ Value functions predict long-term rewards ✔ Bellman equations drive learning ✔ Value iteration & policy iteration are core methods ✔ Modern RL uses neural networks to scale

Understanding value functions is essential for mastering reinforcement learning.

Featured Post

How HMT Watches Lost the Time: A Deep Dive into Disruptive Innovation Blindness in Indian Manufacturing

The Rise and Fall of HMT Watches: A Story of Brand Dominance and Disruptive Innovation Blindness The Rise and Fal...

Popular Posts