This project implements a neural network approach to predict convergence characteristics of Experience-Weighted Attraction (EWA) learning dynamics in 2×2 games, based on Pangallo et al. (2022). This project was the final assignment for the course ''Computational Game Theory'', taught by Prof. Davide Grossi, and was graded 9.7/10. Please refer to DeepEWA_GitHub.pdf for our paper.
Experience Weighted Attraction generalizes various learning algorithms in game theory:
Attraction updating function:
Action selection:
Special cases include:
- Best Response Dynamics (α=1, β=∞, δ=1)
- Fictitious Play (α=0, β=∞, δ=1, κ=0)
- Reinforcement Learning (δ=0)
- Replicator Dynamics (β→0, α=0, δ=1)
- Logit Dynamics (α=1, δ=1, κ=1)
We train a deep neural network to classify convergence outcomes of learning dynamics on 2×2 games into four categories:
- Limit cycles/chaos
- Mixed strategy fixed points
- Pure strategy fixed points
- Pure Nash equilibria
DeepEWA/
├── ProbsEWA.jl # Core EWA algorithm and convergence classification
├── DataGen.jl # Data generation for neural network training (also included in notebook)
├── DeepEWA.ipynb # Main Jupyter notebook with analysis
├── dependencies.jl
├── data/ # Training and test datasets
│ ├── train_data.csv
│ └── test_data.csv
├── images/ # Generated plots
├── notebooks EWA/ # Testing notebooks
├── notebooks NN/ # NN experiments
├── versions EWA/ # Older versions
├── literature/ # References
└── paper/ # Paper
- Install Julia (v1.11 or higher): https://julialang.org/downloads/
Run the following notebook:
jupyter notebook DeepEWA.ipynbFor custom 2×2 games, modify the payoff matrices:
# Example coordination game:
custom_game = [[7 2; 2 3], [7 2; 2 3]]- α (memory loss): [0, 1]
- κ (discount rate): [0, 1]
- δ (foregone payoffs): [0, 1]
- β (temperature): [0, ∞]
- Input: 12 features (4 EWA parameters + 8 payoff matrix entries)
- Hidden layers: 3 layers with 32 ReLU units each
- Output: 4-class softmax for convergence classification
- Optimizer: AdaGrad with learning rate adaptation
- Training: 2500 epochs with batch size 64
Example accuracy results:
- Overall accuracy: ~85-95% depending on game type
- Pangallo, M., et al. (2022). "Towards a taxonomy of learning dynamics in 2 × 2 games"
- Camerer, C., & Ho, T. H. (1999). "Experience-weighted attraction learning in normal form games"
This project is licensed under the MIT License - see the LICENSE file for details.