A reinforcement learning project that trains a DQN (Deep Q-Network) agent to navigate and solve tasks in a GridWorld environment.
The agent learns to navigate a grid world with walls and markers, performing actions like moving, turning, picking/placing markers, and finishing tasks. The environment loads different scenarios from JSON files containing grid layouts, wall positions, and start/goal configurations.
main.py
- Training loop and DQN implementationmodel.py
- Neural network architecture and replay memoryenvs/env_project.py
- GridWorld environment implementationutils.py
- Plotting utilities for training metricsdatasets/
- Training and validation data (easy, medium difficulty levels)
The agent can perform 6 actions:
- Move forward
- Turn left/right
- Pick/put markers
- Finish task
Run training:
python main.py
The script will:
- Load random task configurations from the dataset
- Train the DQN agent using experience replay
- Save the trained model as
model.pth
- Generate training plots (episode duration, loss, rewards)
- PyTorch
- Gym
- NumPy
- Matplotlib
- Pygame (for rendering)
Contains JSON files with grid configurations including:
- Grid size and walls
- Agent start/goal positions and orientations
- Marker locations (pre/post states)