Skip to content

Selfdriving Car made in Pygame with Reinfocement Learning (DQN in Pytorch)

Notifications You must be signed in to change notification settings

Ehrenmann34/SelfdrivingCar-with-DQN

 
 

Repository files navigation

Selfdriving Car using DQN

Description

This project showcases Deep Q-Network (DQN) capabilities to teach agent how to steer a car based on detected distance from a car to the edge of a track. DQN is a type of reinforcement learning algorithm, where agent is placed in certain environment, and is capable of performing specified actions. Based on reward and punishment system, agent tries to maximize rewards, while avoiding punishments. In this example reward is given for every frame the car is driving, while punishment is given when car touches edge of a track.

Features

  • procedurally generated track on every episode
  • raycasting for detecting edges of a track
  • DQN model

Built with

  • Pygame
  • PyTorch

Start of learning process

At the beggining agent is exploring new environment, a lot of crashes are expected.

After 200 episodes

After some episodes agent adapts his driving skill to stay on track for longer period of time.

About

Selfdriving Car made in Pygame with Reinfocement Learning (DQN in Pytorch)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%