Skip to main content

Efficiently generate games for research and experimentation

Project description

Game Generators

Game Generators (gage) is a package for efficiently generating games for research and experimentation. It is loosely based on GAMUT. Its main features are:

  1. Efficiently generate batches of games from a wide range of available game structures that can be used for deep learning purposes.
  2. Sample random utility functions of widely used classes, such as concave functions, monotonically increasing/decreasing functions and more.
  3. In-depth documentation that provides references to the literature.
  4. Extensive test suite to verify the correctness of the generated games.

Installation

For now, Gage is only available for installation from source. To install, clone the repository and pip install the necessary packages.

Quickstart

To start generating games, simply import the package and use the game generator that you desire. For example, to generate a batch of 10 Bach-Stravinsky games, use the following code:

import gage

batch_size = 10
payoff_matrices = gage.nfg.bach_stravinsky(batch_size)

# Or alternatively
payoff_matrices = gage.generate_game("bach_stravinsky", batch_size)

To see all available game generators, see the documentation or check gage.available_games.

Format

Every game is returned with separate payoff tensors per player. For example, when generating a batch of 10 games with 2 players and 3 actions per player, we return a (10, 2, 3, 3) tensor where the first dimension contains the batch, the second dimension contains a payoff tensor for an individual player, and the remainder is the joint action dimension.

It is common in game theoretic research to present joint payoff tensors. We provide a function to convert the separate payoff tensors to a joint payoff tensor. This function is called to_joint_payoff and is available in the utils.transforms module. In the example above, it would return a (10, 3, 3, 2) tensor.

Contributing

We are building a suite of game generators that can be used in modern game theoretic research. If you are working in this area and want to get involved, contributions are very welcome! For major changes, please open an issue first to discuss what you would like to change.

Citation

If you use GAGE in your research, please use the following BibTeX entry:

@misc{ropke2023gage,
  author = {Willem Röpke},
  title = {Gage: Game Generators},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/wilrop/mo-game-theory}},
}

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

game_generators-0.1.1.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

game_generators-0.1.1-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file game_generators-0.1.1.tar.gz.

File metadata

  • Download URL: game_generators-0.1.1.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.10.13 Darwin/22.2.0

File hashes

Hashes for game_generators-0.1.1.tar.gz
Algorithm Hash digest
SHA256 71d118186a4ee8e8683d548a7bc2981865b784139a7393fe287d6fc282c2337e
MD5 92158ee2a0e7d3730b6efa8d732e41fd
BLAKE2b-256 a0f4e7af5dfe76d2afd23eb4ec80d643ccfd180570198b01bddb7e7c6772d76b

See more details on using hashes here.

File details

Details for the file game_generators-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: game_generators-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.10.13 Darwin/22.2.0

File hashes

Hashes for game_generators-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a69ec583446cdbc0b707cf4f6278894a4f69910e4c2a3c47828933ed49be2eac
MD5 9cdfc677529686336651912db591e0be
BLAKE2b-256 e003f061036d846cc12e99333f209539f3f2fff42e7f99b85f0f3859b9f271e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page