TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Teaching AI to race using NNs and genetic algorithms

141 pointsby Halienjaover 8 years ago

12 comments

wjncover 8 years ago
Been staring in awe at this with my little sons (2&amp;3). We actually get enthusiastic when the first signs of understanding arise. Where can I begin learning about this? I&#x27;ve done several sklearn examples, but this application to &#x27;a new world&#x27; (like a racing game), how do you build that?<p>With build I mean, how do you structure inputs and objects so that the goal is met? The goal for racing is both steering, braking, trottle...
评论 #12389825 未加载
评论 #12389893 未加载
impostervtover 8 years ago
Source code: <a href="https:&#x2F;&#x2F;github.com&#x2F;TomaszRewak&#x2F;ML-games" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;TomaszRewak&#x2F;ML-games</a>
评论 #12390082 未加载
skykoolerover 8 years ago
This is really amazing how fast they learn! It seems to make a lot more progress than, for example, that genetic car evolver that at generation 200 is still trying to decide whether to put the wheels on the bottom.
评论 #12391103 未加载
breckinlogginsover 8 years ago
I observed something interesting: when I changed the number of hidden layers from 100 to 1, almost nothing changed.<p>It took slightly more generations to learn how to race, but not that many more (~80 generations vs ~90 generations). In addition, I thought I observed a small difference in behavior, but nothing I could explicitly measure.
评论 #12392425 未加载
zer0gravityover 8 years ago
Generation 50 but none of the cars has learned to pass more than 5-6 corners.<p>Also, changining the track from one interation to another I don&#x27;t think it helps. The training should be done on the same track until at least one of the cars is able to complete it. Than it can be changed.<p>Sometimes some of the cars get stuck and the round doesn&#x27;t finish, without having to click the &quot;End round&quot; button. There should be some mechanism that detects that cars are stuck and end the round automatically.
评论 #12389662 未加载
评论 #12394294 未加载
评论 #12390203 未加载
评论 #12391253 未加载
评论 #12390439 未加载
soaredover 8 years ago
Another awesome one for the collection! It would be interesting to compare this and the RC car: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=1AR2-OHCxsQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=1AR2-OHCxsQ</a><p>r&#x2F;WatchMachinesLearn
ronald_raygunover 8 years ago
I&#x27;ve found some tricks to get it to learn really well (by gen 20 they all finish really fast) 1. Using a relu, return value =&gt; value &gt;= 0 ? value : 0.0; 2. Bumping it up to 30 cars (if you use too many, it slows down, and you dont get as good of results because each iteration takes ages) 3. Changing the lap condition to c.lap &lt; 5 and the time to 30 s. This lets each race go longer and widens the discrepancy between the best and worst racers - which improves selection
eutecticover 8 years ago
Setting the hidden layer activation function to<p><pre><code> value =&gt; value &gt;= 0 ? value : 0.5 * value; </code></pre> seems to improve convergence a lot.
评论 #12393741 未加载
brileeover 8 years ago
Neat!<p>It should be noted that the genetic algorithm used is not the same as reinforcement learning, in which the entire history of decisions leading up to a success is fed back to the NN as training examples.
评论 #12391949 未加载
kyberiasover 8 years ago
So is the genetic algorithm used to mutate the neural network weights?
评论 #12391842 未加载
GordonSover 8 years ago
Nice, I love the way the user can change the NN and genetic algorithm parameters!<p>There isn&#x27;t much documentation though - is the genetic algorithm being used to evolve the NN somehow?
评论 #12389643 未加载
评论 #12389887 未加载
评论 #12389649 未加载
Rhapsoover 8 years ago
<a href="http:&#x2F;&#x2F;www.cs.ucf.edu&#x2F;~kstanley&#x2F;neat.html" rel="nofollow">http:&#x2F;&#x2F;www.cs.ucf.edu&#x2F;~kstanley&#x2F;neat.html</a>