Basics of Reinforcement Learning

अब हम Deep Learning की एक और शानदार शाखा की ओर बढ़ते हैं —
🎮 Reinforcement Learning (RL)
जहाँ agent खुद से environment से सीखता है — trial and error के ज़रिए।


🔶 1. Reinforcement Learning क्या होता है?

Reinforcement Learning (RL) एक ऐसा learning paradigm है जिसमें एक agent environment में actions लेता है और rewards के आधार पर सीखता है कि कैसे बेहतर decision लिए जाएँ।

🎯 “RL is learning by interacting with the environment.”


🧠 Real-World Analogy:

ScenarioRL Mapping
बच्चा साइकिल चलाना सीखता हैAgent learns by falling & balancing
गेम खेलते समय स्कोर बढ़ानाAgent earns reward by right actions
रेस्टोरेंट में नया खाना try करनाExploration of unknown choices

🧩 2. Key Components of RL

ComponentDescription
🧠 Agentजो decision लेता है (AI system)
🌍 Environmentजिसमें agent operate करता है
🎯 State (S)वर्तमान स्थिति (e.g., board configuration)
🎮 Action (A)जो कदम agent लेता है
💰 Reward (R)Action के बदले मिलने वाली feedback
🔄 Policy (π)Action लेने की strategy
🔮 Value Function (V)किसी state की “future reward” expectation
🧮 Q-Value (Q)Action के आधार पर reward की quality

🔁 3. RL का Interaction Cycle (Markov Decision Process – MDP)

     ┌──────────────┐
│ Environment │
└──────────────┘

│ reward r(t)

┌────────┐
│ Agent │
└────────┘

│ action a(t)

state s(t+1) ←─────── state s(t)

🔁 Cycle Explained:

  1. Agent observes state St
  2. Chooses an action At using policy
  3. Environment responds with next state St+1and reward Rt
  4. Agent uses this feedback to improve policy π

🎮 4. Types of Reinforcement Learning

TypeDescription
Positive RLReward मिलने पर behavior को reinforce करना
Negative RLPunishment से गलत behavior avoid करना
🔄 Model-Free RLDirect interaction से सीखना (e.g., Q-Learning)
🧠 Model-Based RLEnvironment का internal model बनाना

📈 5. Applications of RL

DomainExample
🕹️ GamesAlphaGo, Chess, Atari
🚗 RoboticsArm control, walking agents
📈 FinancePortfolio optimization
🌐 RecommendationAd placement, content ranking
🤖 NLPChatbot behavior tuning
🧬 HealthcareTreatment policies, dosage optimization

📝 Practice Questions

  1. Reinforcement Learning और Supervised Learning में क्या अंतर है?
  2. Markov Decision Process (MDP) क्या है?
  3. Policy और Value function में क्या फर्क है?
  4. RL में Reward का क्या महत्व है?
  5. Q-Value क्या दर्शाता है?

🧠 Summary

ConceptExplanation
RLLearning by interacting
AgentLearner / decision maker
EnvironmentWhere actions happen
RewardFeedback for actions
PolicyStrategy to act
Q-ValueExpected future reward for action in state