< Return to Video

10.1: Introduction to Neural Networks - The Nature of Code

  • 0:01 - 0:07
    Hello, welcome to a video that
    at this present time doesn't exist,
  • 0:07 - 0:10
    but when you are watching this video,
  • 0:10 - 0:13
    right there, to the right of 9: Genetic Algorithms
  • 0:13 - 0:15
    will be the number 10,
  • 0:15 - 0:17
    and it will say next to that, Neural Networks.
  • 0:17 - 0:22
    So I am embarking on a journey
    to learn about neural networks:
  • 0:22 - 0:25
    what they are, how you program them,
  • 0:25 - 0:28
    what's the kind of math
    and stuff you need to know
  • 0:28 - 0:31
    to make them work, and then what kinds of creative
  • 0:31 - 0:34
    and experimental outcomes can you have.
  • 0:34 - 0:39
    Now, it should be said that there are lots
  • 0:39 - 0:41
    and lots of machine learning libraries out there.
  • 0:41 - 0:46
    There are lots of examples
    and resources for doing this.
  • 0:46 - 0:48
    I want to--
  • 0:48 - 0:50
    Hold on, I'm still talking.
  • 0:50 - 0:52
    I don't know where--
    Where did I put that book?
  • 0:52 - 0:53
    Ah, it's over here.
  • 0:53 - 0:55
    I want to reference this book,
  • 0:55 - 0:58
    Make Your Own Neural Network by Tariq Rashid,
  • 0:58 - 1:01
    which I used to develop a lot of the materials
  • 1:01 - 1:03
    that I will be presenting to you
  • 1:03 - 1:06
    and developing during this series of videos.
  • 1:06 - 1:09
    And I should also say that, you know--
  • 1:10 - 1:15
    And this book, this book has all sorts--
  • 1:15 - 1:17
    has how to program your own neural network
  • 1:17 - 1:18
    from scratch and without even knowing anything
  • 1:18 - 1:20
    about programming in Python,
  • 1:20 - 1:22
    because, as I might have said earlier today,
  • 1:22 - 1:26
    any reasonable person would start
    and make a video tutorial series
  • 1:26 - 1:29
    about programming a neural network
    from scratch in Python,
  • 1:29 - 1:31
    but I don't really--
  • 1:31 - 1:34
    I'm not very reasonable or logical,
  • 1:34 - 1:37
    and I just constantly make mistakes with everything.
  • 1:37 - 1:38
    And here's a mistake that I'm going to make.
  • 1:38 - 1:40
    I'm going to do all this in JavaScript.
  • 1:40 - 1:42
    And the reason for doing that
  • 1:42 - 1:44
    is to have everything run in the browser,
  • 1:44 - 1:48
    on the web, and also really for me
    to learn about how to do this stuff.
  • 1:48 - 1:52
    So I am going to build a set--
  • 1:52 - 1:56
    I'm going to build a simple
    neural network library in JavaScript,
  • 1:56 - 1:59
    not to make something efficient,
    not to make something robust,
  • 1:59 - 2:03
    but to learn about the mechanics
    of how all this stuff works,
  • 2:03 - 2:06
    because, ultimately--
    and you might want to
  • 2:06 - 2:10
    just enjoy your summer, or maybe
    you're watching this during the winter,
  • 2:10 - 2:12
    and get outside and do something else
  • 2:12 - 2:16
    and not watch these videos
    and just skip ahead to later,
  • 2:16 - 2:18
    because I'm going to do a bunch
    of coding challenges and projects
  • 2:18 - 2:24
    that involve that neural network library
    and also other neural network libraries,
  • 2:24 - 2:27
    namely something called TensorFlow, in future videos.
  • 2:27 - 2:31
    But these first videos of building
    the neural network library,
  • 2:31 - 2:32
    which I will do over a series,
  • 2:33 - 2:36
    really just for me to learn
    how to do this stuff.
  • 2:36 - 2:38
    And if you want to watch and sort of
  • 2:38 - 2:40
    give me some good feedback
    and see if you can follow along
  • 2:40 - 2:42
    and improve on what I'm doing
  • 2:42 - 2:44
    and help me with it,
    that would be great.
  • 2:44 - 2:48
    So, okay, what-- what--
  • 2:48 - 2:50
    Hello, am I just rambling here?
  • 2:50 - 2:52
    I am. But why are we here?
  • 2:52 - 2:54
    So I'm going to go--
  • 2:54 - 2:57
    So the Nature of Code materials in this video
  • 2:57 - 2:59
    sits in the Nature of Code playlist
  • 2:59 - 3:03
    is all about looking at things in nature,
  • 3:03 - 3:04
    in our physical world,
  • 3:04 - 3:06
    and trying to unpack those things
  • 3:06 - 3:09
    and understand the algorithms behind those things,
  • 3:09 - 3:11
    and see if we can convert those things,
  • 3:11 - 3:12
    those algorithms, into code--
  • 3:12 - 3:15
    Ah, this is like going--
    it's like autoplaying. (laughs)
  • 3:15 - 3:17
    How do I stop that?
  • 3:18 - 3:23
    ..and turning those things into software
    to make animations and creative projects.
  • 3:25 - 3:31
    Why not look at something really
    interesting in nature: the brain?
  • 3:31 - 3:35
    So this is kind of a loose diagram of this idea
  • 3:35 - 3:38
    of an actual biological neural network.
  • 3:38 - 3:40
    Apparently, I have one here--
  • 3:40 - 3:43
    I'm struggling quite a bit these days--
  • 3:43 - 3:46
    where there are these entities called neurons,
  • 3:46 - 3:47
    and they're connected to other neurons.
  • 3:47 - 3:51
    And there's a lot of, you know, mystery to this
  • 3:51 - 3:54
    and a lot of recent research [inaudible] neuroscience.
  • 3:54 - 3:58
    What I am focused on in this series of videos
  • 3:58 - 4:02
    is what kinds of computational systems can be built,
  • 4:02 - 4:06
    inspired by the actual biological neural network,
  • 4:06 - 4:09
    biological brain, and made into something
  • 4:09 - 4:13
    called an artificial neural network?
  • 4:13 - 4:18
    And what kinds of applications
    and outcomes can we create?
  • 4:18 - 4:20
    So what is the analog?
  • 4:20 - 4:24
    What is the neuron in our code?
  • 4:24 - 4:28
    How does it receive inputs?
    How does it generate outputs?
  • 4:28 - 4:30
    So my brain does this.
  • 4:30 - 4:33
    It receives all these inputs
    from light in the room
  • 4:33 - 4:36
    that travel through my retina
    and into the brain and the signals
  • 4:36 - 4:40
    then produce outputs that allow me
    to catch something or read some words.
  • 4:41 - 4:45
    How can that process be simulated in software?
  • 4:45 - 4:48
    And what types of outcomes can we generate?
  • 4:48 - 4:51
    And the very first thing that I'm going to do
  • 4:51 - 4:55
    is look at the simplest possible neural network,
  • 4:55 - 4:57
    a net--
    It's not even a network at all.
  • 4:57 - 5:00
    It has one neuron, a processor neuron,
  • 5:00 - 5:03
    that receives two inputs and generates an output.
  • 5:03 - 5:05
    And that's called a perceptron.
  • 5:05 - 5:08
    So if you look at the next videos in this playlist,
  • 5:08 - 5:10
    I am going to build, in Processing,
  • 5:10 - 5:14
    a perceptron example just to show the mechanics
  • 5:14 - 5:18
    of how this works and to produce some trivial example
  • 5:18 - 5:20
    that doesn't necessarily have a very powerful outcome,
  • 5:20 - 5:22
    but gives us--
    Because if we can build
  • 5:22 - 5:25
    and understand how this single neuron
  • 5:25 - 5:28
    receives inputs, processes those,
    and generates an output,
  • 5:28 - 5:32
    then we can start to connect those together
  • 5:32 - 5:34
    to create more sophisticated systems
  • 5:34 - 5:38
    that can begin to generate outputs based on--
  • 5:38 - 5:41
    more complex outputs based on more complex inputs.
  • 5:41 - 5:42
    And this is kind of--
  • 5:43 - 5:46
    sits right there in the world of machine learning,
  • 5:46 - 5:51
    this idea of I have some data
    that I want to make sense of.
  • 5:51 - 5:54
    That data is an input to a machine learning algorithm.
  • 5:54 - 5:57
    That algorithm is going to generate an output.
  • 5:57 - 5:58
    So maybe the data is an image.
  • 5:58 - 6:01
    The machine learning algorithm
    is going to guess is it a cat or a dog?
  • 6:01 - 6:04
    Or maybe that input is the specs of the house,
  • 6:04 - 6:09
    you know, square footage, number of bedrooms,
  • 6:09 - 6:11
    etc., etc., and this machine learning system
  • 6:11 - 6:14
    is going to generate an output: a predicted price.
  • 6:14 - 6:17
    So there are lots of other machine learning algorithms
  • 6:17 - 6:19
    besides just neural network based ones,
  • 6:19 - 6:23
    and I do have another videos series
    that cover some of those,
  • 6:23 - 6:25
    but ultimately I want to learn
    how a neural network works,
  • 6:25 - 6:29
    so I can place it right there
    and start to make sense of data,
  • 6:29 - 6:31
    and generate outputs from it.
  • 6:31 - 6:33
    So if you want to continue along,
  • 6:33 - 6:35
    the way this video series will work,
  • 6:35 - 6:39
    first there'll be a perceptron,
    which is this thing.
  • 6:39 - 6:41
    Then I'm going to talk--
    after the perceptron's done,
  • 6:41 - 6:43
    I'm going to talk about what the limitations
  • 6:43 - 6:45
    of the perceptrons are and why it is
  • 6:45 - 6:48
    that if we can create a multi-layered perceptron,
  • 6:48 - 6:52
    meaning many of these perceptrons
    all connected to each other,
  • 6:52 - 6:55
    what we can start to build
    and create afterwards.
  • 6:55 - 6:58
    So that's my rambling introduction
  • 6:58 - 7:00
    that apparently you just watched,
  • 7:00 - 7:04
    because-- I mean, maybe
    no one will ever watch this,
  • 7:04 - 7:06
    but probably somebody will.
  • 7:06 - 7:09
    And I'll see you. Follow along.
  • 7:09 - 7:12
    I look forward to your feedback.
    I hope this goes okay.
  • 7:12 - 7:15
    That's a pretty good goal.
    Just okay is fine.
  • 7:15 - 7:18
    And I'll see you in these
    future videos as I keep going.
  • 7:18 - 7:19
    Thanks for watching.
  • 7:19 - 7:22
    (upbeat music)
Title:
10.1: Introduction to Neural Networks - The Nature of Code
Description:

Welcome to Chapter 10 of The Nature of Code (http://natureofcode.com/): Neural Networks.

In this video, I provide a brief introduction neural networks and an overview of topics in upcoming videos.

Next video (Perceptron): https://youtu.be/ntKn5TPHHAk

This video is also part of session 4 of my Spring 2017 ITP "Intelligence and Learning" course (https://github.com/shiffman/NOC-S17-2-Intelligence-Learning/tree/master/week4-neural-networks)

Support this channel on Patreon: https://patreon.com/codingtrain
To buy Coding Train merchandise: https://codingtrain.storenvy.com
To donate to the Processing Foundation: https://processingfoundation.org/

Send me your questions and coding challenges!: https://github.com/CodingTrain/Rainbow-Topics

Contact:
Twitter: https://twitter.com/shiffman
The Coding Train website: http://thecodingtrain.com/

Links discussed in this video:
The Nature of Code: http://natureofcode.com/
Session 4 of Intelligence and Learning: https://github.com/shiffman/NOC-S17-2-Intelligence-Learning/tree/master/week4-neural-networks
Perceptron on Wikipedia: https://en.wikipedia.org/wiki/Perceptron
My Simple Artificial Neural Network JavaScript Library: https://github.com/shiffman/Neural-Network-p5

Books discussed in this video:
Tariq Rashid's Make Your Own Neural Network: https://www.amazon.com/Make-Your-Own-Neural-Network-ebook/dp/B01EER4Z4G
Marvin Minsky's Perceptrons: https://www.amazon.com/Perceptrons-Introduction-Computational-Marvin-Minsky/dp/0262631113

Source Code for the all Video Lessons: https://github.com/CodingTrain/Rainbow-Code

p5.js: https://p5js.org/
Processing: https://processing.org

The Nature of Code playlist: https://www.youtube.com/user/shiffman/playlists?view_as=subscriber&shelf_id=6&view=50&sort=dd
For More Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
For More Intelligence and Learning: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YJ3XfHhT2Mm4Y5I99nrIKX

more » « less
Video Language:
English
Duration:
07:32

English subtitles

Revisions