This project implements a Decision Transformer model for predicting game inputs based on state observations. It's designed to learn from gameplay data and generate mouse and keyboard actions.
-
Clone the repository:
git clone https://github.com/yourusername/decision-transformer.git cd decision-transformer
-
Create and activate a conda environment:
conda create -n dt-env python=3.8 conda activate dt-env
-
Install the required packages:
pip install -e .
Convert your CSV gameplay data to SafeTensor format using the provided script:
python scripts/preprocess_data.py --input_file path/to/your/csv/file.csv --output_file path/to/output/safetensors/file.safetensors
Adjust the hyperparameters and settings in configs/config.yaml
:
To train the model, run:
python scripts/training.py
The Decision Transformer is based on GPT-2 and processes state observations, mouse actions, and key actions to predict future actions. Key components:
DecisionTransformer
: Main model classGPT2Model
: Underlying transformer architectureTrainer
: Handles the training loop and evaluation
- Modify
decision_transformer/models/decision_transformer.py
to adjust the model architecture. - Update
decision_transformer/training/trainer.py
to change the training process. - Alter
data/data_loader.py
to modify how data is loaded and processed.