/ Модель

Характеристики

Библиотека
pytorch
Опубликована
31 авг 2026

LunarLander-v2

Обучение с подкреплением3 профессии
0скачиваний за 30 дней0лайковвеса обновлены31 авг 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Обученный PPO-агент на PyTorch управляет посадочным модулем в симуляционной среде LunarLander-v2.

Это обученный агент Proximal Policy Optimization (PPO), созданный автором репозитория Pro152 в рамках курса Hugging Face Deep Reinforcement Learning Course, Unit 8 — Part 1. Агент предназначен для управления посадочным модулем в среде LunarLander-v2: он получает восьмимерное наблюдение о положении, скорости, угле и контакте опор с поверхностью и выбирает одно из четырёх дискретных действий управления двигателями.

Модель реализована на PyTorch и Gymnasium с архитектурой Actor-Critic: отдельные сети актёра и критика используют полносвязные слои с 64 нейронами и активацией Tanh. В обучении применяются PPO с ограничением обновлений, Generalized Advantage Estimation, нормализация преимуществ, энтропийная регуляризация и отсечение градиентов. Это специализированный агент для конкретной симуляционной задачи, а не языковая модель; его входы и действия представлены состояниями и действиями среды. В карточке указана лицензия? Нет, поэтому условия лицензирования по доступным сведениям определить нельзя.

Сценарии применения

  • управление посадкой модуля в LunarLander-v2
  • обучение и демонстрация алгоритма PPO
  • изучение архитектуры Actor-Critic на задаче управления
  • эксперименты с оценкой стратегий в среде Gymnasium

Ограничения

Это учебный проект, и результат зависит от случайного зерна, длительности обучения, гиперпараметров и версии среды. README не приводит фактические результаты оценки и не сообщает лицензию.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

PPO Agent playing LunarLander-v2

This is a trained Proximal Policy Optimization (PPO) agent playing LunarLander-v2.

This project was completed as part of the Hugging Face Deep Reinforcement Learning Course, Unit 8 - Part 1.

The PPO agent was implemented from scratch using PyTorch and Gymnasium, following the PPO implementation and concepts covered in the course.

Environment

The agent was trained on LunarLander-v2.

The goal is to learn a policy that controls a lunar lander and successfully lands it on the landing pad while maximizing the cumulative reward.

The environment provides an 8-dimensional observation describing:

  • Horizontal position
  • Vertical position
  • Horizontal velocity
  • Vertical velocity
  • Angle
  • Angular velocity
  • Left leg contact
  • Right leg contact

The action space contains four discrete actions:

ActionDescription
0Do nothing
1Fire left orientation engine
2Fire main engine
3Fire right orientation engine

Algorithm

The agent uses Proximal Policy Optimization (PPO).

PPO is an on-policy policy-gradient reinforcement learning algorithm that improves the policy while limiting excessively large policy updates.

The implementation includes:

  • Actor-Critic architecture
  • Generalized Advantage Estimation (GAE)
  • PPO clipped surrogate objective
  • Clipped value loss
  • Advantage normalization
  • Entropy regularization
  • Gradient clipping
  • Learning-rate annealing

PPO Clipped Objective

The probability ratio between the current and old policies is:

r_t(theta) = pi_theta(a_t | s_t) / pi_theta_old(a_t | s_t)

The PPO clipped objective is:

L_CLIP = E[min(r_t A_t, clip(r_t, 1-epsilon, 1+epsilon) A_t)]

The clipping coefficient used is:

epsilon = 0.2

Therefore, the clipping range is:

[0.8, 1.2]

Clipping prevents the policy from making excessively large updates.

When the ratio is within the clipping range, the policy can be updated normally.

When the ratio moves outside the range in a direction that would make the policy update excessively large, the clipped objective limits the update.

Generalized Advantage Estimation

The implementation uses Generalized Advantage Estimation (GAE).

The temporal-difference error is:

delta_t = r_t + gamma * V(s_t+1) - V(s_t)

The advantage is estimated recursively using:

A_t = delta_t + gamma * lambda * A_t+1

The implementation uses:

  • Gamma = 0.99
  • GAE Lambda = 0.95

GAE provides a balance between bias and variance when estimating advantages.

Model Architecture

The PPO agent uses an Actor-Critic architecture.

Actor

The Actor receives the environment observation and produces action logits.

Architecture:

Input -> Linear(64) -> Tanh -> Linear(64) -> Tanh -> Linear(4)

The output is used to create a categorical probability distribution over the four possible actions.

Critic

The Critic estimates the value of the current state.

Architecture:

Input -> Linear(64) -> Tanh -> Linear(64) -> Tanh -> Linear(1)

Training Configuration

ParameterValue
EnvironmentLunarLander-v3
AlgorithmPPO
FrameworkPyTorch
Environment libraryGymnasium
Total timesteps100,000
Learning rate0.00025
Number of environments8
Steps per rollout128
Minibatches4
Update epochs4
Discount factor0.99
GAE Lambda0.95
PPO clip coefficient0.2
Entropy coefficient0.01
Value function coefficient0.5
Maximum gradient norm0.5
Advantage normalizationEnabled
GAEEnabled
Learning-rate annealingEnabled
Clipped value lossEnabled
Random seed1

Evaluation

The trained agent was evaluated for 10 episodes.

The evaluation results are stored in evaluation.txt.

The file contains:

  • Number of evaluation episodes
  • Mean reward
  • Standard deviation
  • Individual episode rewards

The evaluation result shown at the top of this model card should be replaced with the actual mean reward from evaluation.txt.

Usage

The trained model is stored as model.pt.

The model contains the PyTorch state dictionary of the trained Actor-Critic agent.

The same Agent architecture must be recreated before loading the weights.

Example:

import torch

agent.load_state_dict(
    torch.load(
        "model.pt",
        map_location="cpu"
    )
)

agent.eval()

The environment can be created using:

import gymnasium as gym

env = gym.make("LunarLander-v2")

observation, info = env.reset()

Repository Contents

  • model.pt - trained PPO Actor-Critic model
  • hyperparameters.txt - PPO training hyperparameters
  • evaluation.txt - evaluation results
  • README.md - model card

Hugging Face Deep Reinforcement Learning Course

This project was completed as part of the:

Hugging Face Deep Reinforcement Learning Course

Unit 8 - Part 1: Proximal Policy Optimization (PPO)

The project demonstrates the implementation of PPO from scratch and its application to the LunarLander environment.

The main learning objectives include:

  • Understanding PPO
  • Implementing an Actor-Critic architecture
  • Collecting experience from multiple environments
  • Implementing Generalized Advantage Estimation
  • Implementing the PPO clipped objective
  • Training and evaluating the agent
  • Sharing the trained model on the Hugging Face Hub

References

  • Hugging Face Deep Reinforcement Learning Course
  • Proximal Policy Optimization Algorithms - Schulman et al.
  • Gymnasium
  • PyTorch

Limitations

This model was developed as an educational project for the Hugging Face Deep Reinforcement Learning Course.

Performance may vary depending on:

  • Random seed
  • Training duration
  • Hyperparameters
  • Environment version
  • Hardware
  • Stochasticity of the environment

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · pytorch

Нельзя запустить

RL-агенты не запускаются как сервис инференса.

Ревизия весов
b460e51

0 моделей