Giter Site home page Giter Site logo

tom-de-backer / ml-project-2021-2022 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ml-kuleuven/ml-project-2021-2022

0.0 1.0 0.0 51 KB

Template and instructions to submit a solution for the assignment.

License: Apache License 2.0

Python 100.00%

ml-project-2021-2022's Introduction

ML Project February 2021

This repository contains the code to setup the final evaluation of the course "Machine Learning: Project" (KU Leuven, Faculty of Engineering, Department of Computer Science, DTAI Section).

Use on departmental computers

The departmental computers will be used to run a tournament and submit your implementation (see detailed instructions below). Additionally, they can be used to train your agents. Due to the current Covid restrictions, it is not possible to access these computers physically. A tutorial to connect via SSH can be found here and additional info is available on the departmental web pages.

You will see a personal directory in:

/cw/lvs/NoCsBack/vakken/ac2021/H0T25A/ml-project/

There is an upperlimit of 50MB on the space that you can use.

OpenSpiel and other packages that you can use are pre-installed in the following virtual environment:

/cw/lvs/NoCsBack/vakken/ac2021/H0T25A/ml-project/venv

Since this virtual environment will be used to run the tournament, you should avoid language features that are not compatible with the installed Python version (3.6.9) or use packages that are not installed.

If you prefer to program in C++, you can find up-to-date versions of cmake and clang in:

/cw/lvs/NoCsBack/vakken/ac2021/H0T25A/ml-project/software

Although, note that you will still have to write a Python wrapper to be able to participate in the tournament.

Local installation

This section describes how get started with using FCPA in OpenSpiel.

First, install OpenSpiel as described on the github site. Importantly, you must prepend a flag that will ensure it compiles the optional dependency on the ACPC poker engine.

cd /path/to/open_spiel
BUILD_WITH_ACPC=ON ./install.sh
BUILD_WITH_ACPC=ON ./open_spiel/scripts/build_and_run_tests.sh

# Fix to PYTHONPATH, reload shell if necessary, etc.
. ./venv/bin/activate
python3 open_spiel/python/examples/poker_fcpa_example.py

This will run two random players in FCPA poker. You can also play fixed policies like always-call and always-fold, in addition to playing against them yourself on the keyboard by passing flags:

python3 python/examples/poker_fcpa_example.py \ 
    --player0=random --player1=human

Tournament

The tournament will be played with agents that are available on the departmental computers. This will allow you to try your agent in the identical environment that is used by the tournament script. For this to work, you have to adhere to the following setup:

  • Your agent extends the Agent class provided in the file fcpa_agent/fcpa_agent.py.
  • The tournament code will scrape the directory provided for you on the departmental computers for the fcpa_agent.py file and call the get_agent_for_tournament method. If multiple matching files are found, a random one will be used.
  • Your agent should be ready to play in a few seconds, thus use a pre-trained policy. An agent that is not responsding after 10 seconds will forfait the game.

Submission using the Departmental Computers

To submit your agent, a copy of you code and agent needs to be available on the departmental computers in a directory assigned to you (only your own code, openspiel and other libraries are provided). Also the code to train your agent should be included.

The departmental computers have openspiel and its dependencies installed such that you can verify that your agent works. During the semester the tournament script will be run to play games between the (preliminary) agents that are already available. A tentative ranking will be shared.

FAQ

Installation cannot find tensorflow

Tensorflow is not compatible with Python3.9 use Python3.8 or earlier.

On macos you can use an older version by running these commands before the install script:

brew install [email protected]  # if using homebrew
virtualenv -p /usr/local/opt/[email protected]/bin/python3 venv
. ./venv/bin/activate

Module absl not found

Install the required packages (in the virtual environment).

pip install -r requirements.txt

openspiel or pyspiel not found

First, check if the pyspiel module is available in build/python. If it's absent compilation failed. Try compiling again.

Second, make sure the modules can be found by Python by setting the PYTHONPATH environment variable:

export PYTHONPATH=.:./build/python:$PYTHONPATH

ml-project-2021-2022's People

Contributors

wannesm avatar probberechts avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.