GithubHelp home page GithubHelp logo

cugtyt / carai-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heucoder/carai-demo

0.0 2.0 0.0 12 KB

使用浅层神经网络和遗传算法训练一个可以自动驾驶小车的Demo

Python 100.00%

carai-demo's Introduction

carAI-Demo# carAI-Demo

此项目运行需要额外安装numpy和pygame库 此项目使用pygame搭建了一个简单的赛道,使用一些正方形作为赛车,同时对每个赛车生成一个神经网络来控制它的方向和速度;使用遗传算法来挑选表现好的神经网络。经过多次迭代后,可以训练出驾驶小车成功到达终点的神经网络。

做这个demo的原因戳这里: https://zhuanlan.zhihu.com/p/56319305 ###1.文件说明 #####mainGame.py 程序的入口,其中GameStart()使用遗传算法来训练神经网络 testAI()可以单独观察训练好的神经网络效果 #####myItem.py 赛车类car: 其中包含赛车当前的位置,角度,速度,以及距离赛道边缘的长度等赛车的属性 circle类: 主要用于生成赛道 #####myCarAI.py CarAI类:接收赛车的角度、速度以及距离赛道边缘长度作为输入;输出两个值控制赛车的角度和速度 gene_algo类:使用遗传算法生成新的网络。不过这里我只是简单的进行了权值扰动生成新的网络。 #####para_data文件夹 存放了一个训练好的神经网络

##视频连接戳这里:

carai-demo's People

Contributors

heucoder avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.