
A Neural Network in 11 Lines of Python - devy
https://iamtrask.github.io/2015/07/12/basic-python-network/
======
gambler
I am sick of reading about anything "deep" and "neural" on Hacker News
(especially hype/puff pieces), but this blog post is so well-written that I'm
upvoting it despite being about ANNs. I guess proper knowledge is the opposite
of hype anyway.

I wish research papers on AI were a bit more like this and bit less like what
they are.

~~~
iamtrask
Per your last comment, I'm thinking about changing this blog series to be a
"blog" version of academic papers... starting with this one.

[https://iamtrask.github.io/2016/02/25/deepminds-neural-
stack...](https://iamtrask.github.io/2016/02/25/deepminds-neural-stack-
machine/)

~~~
partycoder
I love your blog, keep up the good work.

~~~
williamtrask
Thank you!

------
ktRolster
I thought it would be using a library, and I thought to myself, "of course, 11
lines is easy."

But all it uses is numpy. Pretty cool.

------
froh42
Cool article, absolutely annoying CSS theme - as I tend to scroll back a
little the title bar is jiggling in and out all the time. A number of sites
uses this and this is SOOO distracting.

~~~
skypather
@froh42: What browser you were using? I read the article using Firefox on my
PC (Windows 7) and I don't have any problems.

------
qmmm
derivative of sigmoid is wrong. should be sigmoid(x)*(1 - sigmoid(x))

~~~
zodiac
It seems like when he passes deriv=True in line 36 the first argument is the
output of a previous nonlin, so it actually is the correct derivative.

~~~
williamtrask
Correct. I believe most implementations do it this way for efficiency... but
my naming could be better.

------
roguas
bad python code (why `if var==True:` instead just `if var:`) also linting
would go crazy, use spaces ;)

great example though!! ;)

------
zenlikethat
Looks like a nice article with lots of relevant content and code! Thanks for
the in-depth piece iamtrask.

------
senthil_rajasek
perhaps the best thing I learned from this blog post is (in the author's own
words), "I worked with neural networks for a couple years before performing
this exercise..."

This contradicts the title. It may be 11 lines of python but not before 2
years of learning neural networks.

------
kbenson
12 lines. He forgot to import numpy. Pretty cool though.

