Git Product home page Git Product logo

bridgebidding.jl's Introduction

BridgeBidding.jl - Learning Bridge Bidding using Knet

Source code and datasets for my masters thesis: "Training a Bridge Bidding Agent using Minimal Feature Engineering and Deep Reinforcement Learning". It contains various ways to apply Reinforcement Learning with Policy Methods to the Bridge Bidding problem using Julia and Knet.

Repository Structure

  • Source: implementation of everything for the bridge learning process.
  • Datasets: collection of various datasets utilized for either supervised or reinforcement learning.
  • Scripts: collection of handful script that I've used that can either be directly run or serve as examples.

Getting Started

Prerequisites

Following Julia packages are required for this repository.

using Pkg; Pkg.add(["Knet", "JSON", "Random", "StatsBase", "IterTools"])

Example Script

#Load BridgeBidding.jl and Knet
include("BridgeBidding/src/BridgeBidding.jl"); using .BridgeBidding, Knet;

#Load the datasets
ddtrn = generate_doubledummy_gameset("BridgeBidding/data/dd-train-5120k.txt", batchsize=64)[1];
ddevl = generate_doubledummy_gameset("BridgeBidding/data/dd-eval-10k.txt", batchsize=64)[1];

#Define the model and it's optimizers
model = RnnMlpMultiHeadModel(cardembed=64,bidembed=64,vulembed=64,lstmhidden=1024,mlphidden=[1024]);
for param in Knet.params(model); param.opt = Rmsprop(lr=1e-3); end;

#Set-up a standard Advantage Actor Critic process
trainer = A2C(model, ddtrn);

#Add an evaluation loop every 800 iterations
gse = GameScoreEvaluator(ddevl);
evalfun = ()->begin println(stderr); gse(model); end
trainer = evaluate(evalfun, trainer, cycle=800);

#Run the Reinforcement Learning process
progress!(trainer);

bridgebidding.jl's People

Contributors

sophylax avatar

Watchers

James Cloos avatar  avatar

Forkers

denizyuret

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.