Skip to content

alxmra/relesu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

(Re)inforcement (Le)arning for (Su)eca Environment

An attempt to create a Reinforcement Learning Agent to play the card game Sueca

Table of Contents
  1. About The Project
  2. Getting Started

About The Project

This project is a Reinforcement Learning (RL) environment designed to train and evaluate agents playing the classic Portuguese card game Sueca. The implementation includes a game engine, multiple agent types (random, heuristic, and DQN-based), and tools for training and visualizing agent performance. The goal is to create intelligent agents that can learn optimal strategies for playing Sueca through reinforcement learning.

Built With

Python
Python
PyTorch
PyTorch
Matplotlib
Matplotlib
NumPy
NumPy

Getting Started

Installation

Allegedly you can run this project anywhere, given your machine can handle the computation required. As for python dependencies, after you clone the repository you need the following:

pip install -r requirements.txt

Usage

python learn.py learn.py [-h] [-s SAVE] [-n N] [-l [LOAD ...]] [-q] [-t TEAMS]
Option Description
-h, --help Show this very same help message
-s SAVE, --save SAVE Save the current model into a file after training, for later loading
-n N Number of episodes (NOTE: only changes if you are using your GPU)
-l [LOAD ...], --load [LOAD ...] Load a previously trained model to have it play as well (supports multiple files/agents)
-q, --test Won't train any new agent: Use to test with whatever agents you load (or not)
-t TEAMS, --teams TEAMS Define the teams. Example: "r,t0,t1,n" with (r)andom, (t)rained+index, (h)heuristic and (n)ew. Index is used if there is more than one trained agent loaded (otherwise use just 't')

Example

python learn.py -t n,h,t,h -s trained_agent_name -l another_trained_agent_name -n 5000

Further notes

The next step I'm currently on is creating a very simple interface to actually watch games rather than relying into the logs and staring at ugly ratio graphs.

About

An attempt to create a Reinforcement Learning Agent to play the card game Sueca

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages