Skip to content

Conversation

moderouin
Copy link
Contributor

This PR introduces two new strategies based on transformer-style neural networks with attention mechanisms:

  1. Attention: A base strategy with a randomly initialized neural network
  2. EvolvedAttention: A strategy using a pre-trained model optimized through self-play

These strategies represent a modern machine learning approach to the Prisoner's Dilemma, capturing complex patterns in game history through attention mechanisms rather than using hand-crafted rules.

The model processes the last 200 moves of both players, encoding game states (CC, CD, DC, DD) and using self-attention layers to identify patterns and make decisions. The implementation includes a complete neural network architecture with embeddings, attention layers, and classification components.

The pre-trained weights for the EvolvedAttention model are loaded from external data files.

@moderouin moderouin closed this Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant