Giter Club home page Giter Club logo

collusion's Introduction

Algorithmic collusion and experience replay

This repository contains code for the paper "Understanding algorithmic collusion with experience replay". Feel free to contact me for any problems in the code.

Dependencies

  • Python 3 with NumPy
  • PyTorch

Usages

To reproduce results in the paper, a random seed 12345 is used for PyTorch, NumPy, and Random module in Python. When generating benchmark results, I run the code with CPU to avoid unexpected randomness from GPU. However, GPU also reproduces the same outcomes in my tests. I use Python 3.7.2 with NumPy 1.16.2 and Torch 1.7.1. Refer to the paper for abbreviations used below.

Classic Q-learning

  • C-Online: classic_online.py
  • C-Random: classic_random.py
  • C-Rank: classic_rank.py

Deep Q-learning

  • D-Random: deep_random.py
  • D-Online: use deep_random.py. But modify optimize_model method in utils.py by changing sampling to transitions = memory.recent(BATCH_SIZE) instead
  • D-Rank: deep_rank.py

Heterogeneous players

  • C-Online vs D-Random: htrg_conline_drand.py
  • C-Online vs D-Rank: Use htrg_crank_drank.py but modify Line 80, If statement with l_state. Make the classic player use online algorithm
  • C-Rank vs D-Rank: htrg_crank_drank.py

Figures

Jupyter Notebooks in figs generate figures in the paper, with outputs from code above. In addition, cdrk_mimic.ipynb produces the last figure for the mimicking experiment.

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.