Git Product home page Git Product logo

ml_project20's Introduction

ML Project 2020

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 research group).

Installation

The easiest setup is to simply copy the module tournaments.py to your own code repository. You will need Python>=3.6, openspiel, pandas, numpy and click.

Usage

Exporting an agent to a CSV file

You will have to submit your agent's policy (both as 1st and 2nd player) as a CSV file. These CSV files should follow the <teamname>_p<pid>.csv naming convention. For example, if you are team robberechts_meert, you should deliver two csv files: robberechts_meert_p1.csv and robberechts_meert_p2.csv. You can use the code below to create these CSV files:

from tournament import policy_to_csv

game = pyspiel.load_game("leduc_poker")
policy = <your policy for agent 1>
policy_to_csv(game, policy, '/models/agent_p1.csv')

Note that you can use PolicyFromCallable to create a policy from any function f(state) : action.

def _random_policy(state):
  actions = state.legal_actions()
  return np.choice(actions)

game = pyspiel.load_game("leduc_poker")
callable_policy = policy.PolicyFromCallable(game, _random_policy)

Playing a tournament

For the final evaluation of your agent we will play a round robin (pairwise) tournament, in which each agent will play many games (pairwise) against all other agents.

python tournament.py 'leduc_poker' <modeldir> <outputdir> --rounds 20

This script will generate two files ranking.csv (containing the final rankings) and results.csv (containing the result of each individual game). On these outcomes we will do a game-theoretic analysis to determine the winners.

ml_project20's People

Contributors

probberechts avatar piet-g avatar vontum 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.