How to build a simple neural network in 9 lines of Python code

John Ladasky john_ladasky at sbcglobal.net
Thu Jun 29 05:24:15 EDT 2017


On Tuesday, June 27, 2017 at 12:34:46 PM UTC-7, Marko Rauhamaa wrote:
> John Ladasky <j...y at s...l.net>:
> > OK, that's cheating a bit, using Numpy. It's a nice little program,
> > but it leverages a huge, powerful library.
> 
> What would *not* be cheating? A language without a library would be
> dead.

Python's standard library is huge, and useful.  Numpy is not part of Python's STANDARD library.

I love Numpy, and use it in almost everything I write.  But I see that many people won't need it, would find it overwhelming, and would find its way of doing things rather different than standard Python (vectorized mathematical operations, fancy slicing, broadcasting, etc.).

So to use Numpy in a post that says, "implement a neural network in Python with just nine lines of code!" seems a little misleading to me.  Python is IMHO the best programming language in use today -- and it's the best one for a beginner to start learning.  But I wouldn't want to oversell the language to a novice programmer.  It's going to take you a long time to understand exactly what those nine lines of code are doing, if you're new to this.



More information about the Python-list mailing list