DI-sheep  by opendilab

RL agent for "3 Tiles" game

created 2 years ago
462 stars

Top 66.5% on sourcepulse

GitHubView on GitHub
Project Summary

DI-sheep integrates Deep Reinforcement Learning (DRL) with the popular "3 Tiles" game, commonly known as "羊了个羊" (Yang Le Yang Le). It aims to develop AI agents capable of playing this challenging puzzle game, offering a platform for DRL research and application. The project targets AI researchers, developers, and enthusiasts interested in applying DRL to game-playing scenarios.

How It Works

The core of DI-sheep utilizes the DI-engine framework for DRL training. It implements a Proximal Policy Optimization (PPO) algorithm with an Actor-Critic neural network architecture built on PyTorch. The game itself is encapsulated as a gym-compatible environment, allowing standard DRL training pipelines. This approach leverages established DRL techniques to tackle the game's complexity, providing a structured way to train and evaluate AI agents.

Quick Start & Requirements

  • Local Deployment/Testing:
    • Server (Python): cd service && pip install -r requirement.txt && FLASK_APP=app.py flask run (for human play) or FLASK_APP=agent_app.py flask run (for human + AI play).
    • Client (React): cd ui && npm run build && npm run preview.
  • DRL Training:
    • cd service && pip install -r requirement-train.txt && python3 -u sheep_ppo_main.py.
  • Prerequisites: Python 3, Node.js, React.
  • Resources: Requires PyTorch. Pre-trained models are available on OpenDILab HuggingFace.
  • Links: Online Demo (under improvement), DI-engine, HuggingFace Models.

Highlighted Details

  • Leverages DI-engine for DRL training.
  • Implements PPO with an Actor-Critic model using PyTorch.
  • Provides a gym-compatible environment for the "3 Tiles" game.
  • Offers pre-trained models for immediate testing.
  • Includes a React-based web UI for interactive play.

Maintenance & Community

The project is actively seeking contributions and community engagement via GitHub Issues and Pull Requests. Future updates are planned, focusing on algorithm tuning, model availability, and environment enhancements.

Licensing & Compatibility

DI-sheep is released under the Apache 2.0 license, which permits commercial use and integration with closed-source projects.

Limitations & Caveats

The online demo is currently under improvement. While pre-trained models are available, the project notes that the agents still have significant room for improvement. Future work includes exploring model-based RL and planning algorithms, as well as optimizing environment speed with JAX.

Health Check
Last commit

4 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
12 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.