~skeeto/public-inbox

1

Comment on "You might not need machine learning"

Janusz Szczypka
Details
Message ID
<CAH0t=4yr_eSCs+t8mbHuCCxBu+w0LfzW9wX_ZD-f7XqPOjeFYA@mail.gmail.com>
DKIM signature
pass
Download raw message
Hi,

I have read your article and - despite I rarely do such things -
decided to send you my comments as your article is completely wrong in
so many places. While the statement that you might not need AI in
places where it is used nowadays could be true, your article does not
show it at all.

You claim that using polynomials is simpler than using NN, but your
polynomial is a trivial case of NN with single layer and linear
activation functions, which already makes this statement false.
Instead of doing calculations to pick your coefficients by doing some
math that will give you best solution (I will write below why it was
wrong in that situation), you just did exactly what is using a genetic
algorithm to train NN - you randomly selected some coefficients and
picked the best combination. Again it was trivial use of that
algorithm with just one single generation.

That was the main point of my e-mail, but I would also like to comment
on the rest of your article.

You claim that your simple polynomial will behave "without any loss in
capability" than 3 layers NN. I believe that you haven't tested that -
calculating speed based only on distance to the obstacle directly in
front is not the best way to drive a car - you normally take into
account curves because so you know that you do not have to slow down
if you are going to turn. More complex NN will use it, your simple is
slowing down a car without a reason.

You have also picked wrong outputs of your polynomial - you do not
drive a car by controlling speed - you control acceleration and
breaking separately. As you have only one equation to calculate
anything related to speed and the result is always positive, I assume
that what you call "throttle" in your equation is in fact direct
control of speed.
And the reason why it was wrong to calculate coefficients anyway, is
that your model is also too trivial. Cars have limits on speed and
turning radius, but they should also have limits on acceleration,
braking and (in more complex model) a limit on rate of turning the
steering wheel. With a limit on acceleration and/or steering wheel
turning rate - ANY C1 will make the car work, so you just pick the
maximum allowed by model and the car will never hit anything - if it
is too close to an obstacle, the system will slow it down from any
speed to zero instantly.

Ignoring input0 and input4 doesn't make any difference in your model
anyway, but normally when you drive a car you would like to be outside
the curve to have smaller centrifugal force, which more complex NN
working on more complex models take into account.

Best regards,
Janusz
Details
Message ID
<20201213192007.tccf4xlm4usdobxv@nullprogram.com>
In-Reply-To
<CAH0t=4yr_eSCs+t8mbHuCCxBu+w0LfzW9wX_ZD-f7XqPOjeFYA@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> but your polynomial is a trivial case of NN with single layer and 
> linear activation functions, which already makes this statement false.

My point is that the non-linear properties of a neural network — the 
main reason to use a neural network in the first place — are unnecessary 
for navigating a driver around a racetrack in a manner described in the 
NN video, and I prove that by using a linear model to successfully 
navigate several courses like the one in the NN video. My model being a 
trivial linear NN doesn't change this. Lots of things are NN subsets, 
but it's not useful to call them NNs.

> Again it was trivial use of that algorithm with just one single 
> generation.

Which was my point. My approach is so trivial that it's not useful to 
call it a generic algorithm or neural network. Otherwise many things can 
be classified as such ("I rolled some dice and multiplied some numbers, 
therefore our startup uses generic algorithms and neural networks.")

After I watched the NN video, it took me about two hours to implement my 
idea from scratch, including renderer. My original plan was to keep the 
genetic algorithm since I thought it was still necessary, but my 
randomly-chosen coefficients were enough to produce lots of drivers in 
the first "generation" that could complete the course. My fitness metric 
was going to be distance traveled before crashing, but by this metric 
the first generation was already perfect. It worked better and sooner 
than I had hoped.

> calculating speed based only on distance to the obstacle directly in 
> front is not the best way to drive a car

True. I didn't go into it in my article, but I did later try a higher 
degree polynomial where the "throttle" is the cube of the distance to 
then nearest obstacle, and those drivers do indeed perform a lot better. 
I didn't include it because:

1) My original model was Good Enough to prove the concept.

2) With cubed distance the drivers become *so* consistently good that 
they're actually kind of boring to watch due to lack of variation. For 
my article video it was more important to be interesting than fast.

Without changing any of the original 5 inputs, I bet there are many 
polynomials that drive better than the two I selected, which were just 
the first to come to mind. If I needed a better driver, I'd design 
better polynomials before I'd reach for a NN. As you pointed out, input0 
and input4 could be useful to a smarter driver.

You're right that I didn't prove that my polynomial model performs as 
well as a NN. I'd need to prove that a non-linear relationship between 
input and output does not make a better driver (which is still my 
hypothesis). My statement about "without any loss in capability" was 
intended to mean that my drivers appear to perform as well as those 
shown in the video, as in they're as capable as *that* NN.

> I assume that what you call "throttle" in your equation is in fact 
> direct control of speed.

That's correct, good catch! I believe this could be corrected by giving 
the "throttle" polynomial a zero term to bias the result, then I could 
use it as break and gas pedal (with similar physical limitations as 
steering).

throttle = C1*input + C2

> ANY C1 will make the car work, so you just pick the maximum allowed by 
> model and the car will never hit anything

This is not true, by design. There is a minimum and maximum speed, and 
it's tuned such that drivers can't complete the course without slowing 
down on some turns: At maximum speed, the turns have a radius that 
exceed that car's turn radius. If they don't slow down, they will crash 
regardless of perfect steering. If you look carefully at my video, you 
can see crashed vehicles around sharp bends, and even witness a couple 
of crashes occurring. Aside from the very first curve, these drivers 
steer fine but don't slow down enough.

The minimum speed is mostly a programming shortcut so that I don't have 
to worry about handling or detecting cars getting stuck (i.e. infinite 
loop). They either complete the course or crash (i.e. halt).
Reply to thread Export thread (mbox)