Hugging Face Deep Reinforcement Learning Course (v2.0)

repository·main·Indexed 26 days ago

https://github.com/huggingface/deep-rl-class

Materials for the Deep Reinforcement Learning Course (v2.0), featuring theory documentation in MDX format and practical Jupyter notebooks. The course covers Deep RL concepts, including Q-Learning, Deep Q-Learning, and the use of Gymnasium, Stable Baselines3, and RL-Baselines3 Zoo. It includes guides for setting up compatible Python environments in Colab, configuring ML-Agents, and publishing trained models to the Hugging Face Hub.

Tokens
59.3K
Snippets
107
Records
308
Agent score
88%

What's inside deep-rl-class

  1. Overview of Proximal Policy Optimization (PPO) in Unit 8

    main

    Unit 8 focuses on Proximal Policy Optimization (PPO), an architecture designed to improve training stability by preventing excessively large policy updates. Unlike A2C, PPO uses a ratio to measure the difference between the current and old policy, clipping this ratio within a specific range $[1 - \epsilon, 1 + \epsilon]$ to ensure stable updates.

    This unit is divided into two practical parts:

    1. PPO from scratch: Learn the theory and implement a PPO agent using the CleanRL implementation. The target environment for testing robustness is LunarLander-v2.
    2. Advanced PPO optimization: Explore deeper optimization techniques using Sample-Factory to train an agent in VizDoom environments.
  2. Introduction to Policy-Based Methods and REINFORCE

    main

    This unit transitions from value-based methods (like Deep Q-Learning) to policy-based methods. Unlike value-based methods that estimate a value function to derive a policy, policy-based methods optimize the policy directly.

    Key concepts covered:

    • Policy-based methods: Optimizing the policy $\pi$ without an intermediate value function step.
    • Policy Gradient: A subset of policy-based methods.
    • REINFORCE: A Monte Carlo policy gradient algorithm.

    Learning objectives include implementing the REINFORCE algorithm from scratch using PyTorch and testing its robustness in the CartPole-v1 and PixelCopter environments.

  3. Introduction to Q-Learning and Value-Based Methods

    main
    This unit covers value-based Reinforcement Learning (RL) methods, focusing on the Q-Learning algorithm. You will learn the distinctions between Monte Carlo and Temporal Difference Learning and implement a Q-Learning agent from scratch. This knowledge serves as the foundation for understanding Deep Q-Learning (DQN), which is used for complex tasks like playing Atari games.
  4. Overview of Godot RL Agents

    main

    Godot RL Agents is an open-source package that enables learning complex behaviors for NPCs or agents in games created with the Godot Engine.

    Key features include:

    • Python Interface: Connects Godot games to ML algorithms running in Python.
    • Framework Wrappers: Supports StableBaselines3, CleanRL, Sample Factory, and Ray RLLib.
    • Agent Architectures: Support for memory-based agents using LSTM or attention-based interfaces.
    • Dimensionality: Works with both 2D and 3D games.
    • AI Sensors: A suite of sensors to augment agent observations.
    • License: MIT License.
  5. Introduction to Deep Reinforcement Learning foundations

    main
    This unit introduces the foundations of Deep Reinforcement Learning (DRL). You will learn how an agent learns to behave in an environment by performing actions and observing results. The curriculum covers training a lunar lander agent using the Stable-Baselines3 library and uploading the resulting trained model to the Hugging Face Hub.
  6. Introduction to Multi-Agent Reinforcement Learning (MARL)

    main
    This unit transitions from single-agent systems to Multi-Agent Reinforcement Learning (MARL). The goal is to train agents that can interact, collaborate, or compete within a multi-agent system. In this unit, you will train agents for a 2vs2 soccer environment where teams must compete against each other.
  7. Introduction to Deep Q-Learning

    main
    Deep Q-Learning (DQN) is a Deep Reinforcement Learning algorithm designed for environments with large or continuous state spaces where traditional Q-tables become ineffective. Instead of a discrete table, DQN uses a Neural Network to approximate Q-values for each action given a specific state. This unit focuses on training agents for complex environments like Atari games.
  8. Differentiate between Policy-based and Value-based RL methods

    main

    There are two primary approaches to solving Reinforcement Learning problems:

    • Policy-based methods: These methods train the policy $\pi$ directly to learn which action to take given a specific state.
    • Value-based methods: These methods train a value function to estimate the value of different states. The agent then uses this value function to select actions that lead to the most valuable states.
  9. Understand Reinforcement Learning (RL) fundamentals

    main

    Reinforcement Learning is a computational approach where an agent learns to interact with an environment through trial and error. The agent receives feedback in the form of rewards (positive or negative) and aims to maximize its expected cumulative reward (also known as expected return). This is based on the reward hypothesis, which states that all goals can be described as the maximization of this expected return.

    The RL process follows a continuous loop of: state $\rightarrow$ action $\rightarrow$ reward $\rightarrow$ next state.