COMP 3200 - Intro to Artificial Intelligence - Lecture 20 - Intro to Neural Networks
Overview
Dave Churchill introduces neural networks as function-approximation systems built from weighted dot products, activation functions, and layers, then explains how supervised training adjusts weights through backpropagation and gradient descent. He traces the path from threshold logic units and perceptrons to modern neurons, connects deep networks to AlexNet’s 2012 ImageNet breakthrough and AlphaGo’s learned value and policy networks, and demonstrates classification and feature construction with TensorFlow Playground.
Key takeaways
- A threshold logic unit computes a weighted dot product and compares it with a threshold, so it can represent only functions whose classes are separated by one hyperplane.
- A neural network overcomes single-unit limits by combining multiple neurons and layers, allowing several simple decision boundaries to form more complex classifications.
- Supervised training compares feed-forward predictions with labeled targets, then uses loss and backpropagation to update weights; gradient descent is a common, but not exclusive, optimization method.
- Bias weights absorb thresholds into the weighted sum, while smooth activations such as sigmoid make gradient-based training possible where a step function is nondifferentiable.
- AlphaGo used a value network to estimate outcomes and a policy network to prioritize moves, showing how learned predictions can guide search rather than replace it.
- TensorFlow Playground demonstrates that feature transformations, such as using distance-related coordinates for circular data, can make a problem linearly separable and reduce the network size required.
Chapters
- Dave Churchill recounts how MIT considered dropping neural networks from its introductory AI course around 2010 because they seemed dated.
- In 2012, Geoffrey Hinton’s group used a deep convolutional network with about 60 million parameters to excel at ImageNet classification.
- The ImageNet breakthrough helped bring neural networks back into focus, with later applications including AlphaGo and modern large language models.
- Churchill describes dendrites as receiving electrical signals and axon terminals as transmitting outputs to other neurons.
- A neuron can fire after stimulation, then enter a refractory period before firing again.
- The biological analogy emphasizes connected units and parallel activity, rather than claiming artificial neurons reproduce the brain’s full biology.
- A threshold logic unit (TLU) multiplies binary inputs by real-valued weights and sums the products as a dot product.
- The TLU outputs 1 when the sum exceeds its threshold and 0 otherwise.
- The same basic computation is repeated throughout neural networks, with different inputs and weights.
- For an AND gate, weights 3 and 2 with threshold 4 produce 1 only when both binary inputs are 1.
- A TLU’s decision boundary separates input combinations into output classes; in two dimensions, that boundary is a line.
- In three dimensions the boundary is a plane, while higher-dimensional versions are called hyperplanes.
- Some Boolean functions cannot be separated into zero and one outputs by a single line, so one TLU cannot represent them.
- Combining TLUs can create multiple decision boundaries, such as two lines that isolate a region a single line cannot separate.
- Churchill uses this limitation to motivate networks of computational units rather than relying on one threshold unit.
- Unlike a TLU, a perceptron can accept real-valued inputs and applies an activation function to its weighted sum.
- The perceptron still uses a step-like output, such as 1 above zero and -1 below zero.
- A neural network organizes units into input, hidden, and output layers, passing each layer’s outputs forward as the next layer’s inputs.
- Classical supervised training pairs inputs, such as fruit-image pixels, with known target outputs such as apple, banana, or pear.
- A feed-forward pass produces predictions; a loss measures their difference from the targets.
- Backpropagation sends error information backward through the network so its weights can be updated.
- Gradient descent is a common weight-optimization method, although other approaches, including genetic algorithms, can also search for weights.
- Training aims to reduce the difference between a desired function’s outputs and the neural network’s approximations.
- Gradient descent uses derivatives to determine how to change weights, illustrated with a contour map over two weights, W1 and W2.
- Repeated updates can lower error, but optimization may settle at a local minimum rather than the global minimum.
- Backpropagation requires differentiable operations, which creates a problem for the perceptron’s discontinuous step activation.
- A bias input fixed at 1 lets a learned weight represent an offset, folding the threshold into the weighted sum.
- Replacing a step function with a smooth activation such as the sigmoid makes derivatives available for training.
- Other activation choices include tanh and ReLU; the modern neuron combines inputs, weights, a bias, and an activation function.
- In a fully connected network, each neuron’s output feeds every neuron in the next layer; unhelpful connections may learn small weights.
- A handwritten-digit classifier can take 784 MNIST pixel values as inputs and produce 10 outputs, one for each digit.
- Classification commonly uses one output per class, while regression may use a single numerical output.
- Churchill argues for using the smallest network that can perform the task, since unnecessary parameters increase training and computation.
- Neural networks can approximate classification or regression functions, including a pathfinding heuristic that estimates distance while accounting for obstacles.
- AlphaGo combined Monte Carlo tree search with a value network that estimated game outcomes and a policy network that suggested promising moves.
- The value network learned from game outcomes, while the policy network learned moves from professional Go games, reducing the search space.
- AlphaZero later used self-play reinforcement learning, with search helping guide action selection and exploration.
- TensorFlow Playground visualizes two-class orange-and-blue datasets and shows how network size affects classification.
- A single neuron can classify linearly separable groups, while concentric classes require multiple boundaries if the original coordinates are used.
- Transforming coordinates using distance-related features can make a circular classification problem separable with one neuron.
- The demonstrations show that simplifying or transforming inputs can reduce the network complexity needed.
- For data arranged in four quadrants, multiple neurons or layers can combine simpler boundaries into a more complex classifier.
- TensorFlow Playground illustrates how two layers with two neurons each can build a different representation than four neurons in one layer.
- In image recognition, early layers may detect light-dark contrasts and edges, while later layers combine them into corners and larger structures such as faces.
- The lecture closes by recommending hands-on experimentation with TensorFlow Playground rather than treating the demo as an exam exercise.
Transcript excerpt
0:01 So lecture number 21, we're going to be talking about sort of an introduction to neural networks. This is going to be the first of three related uh videos on neural networks. So there's this one which is an intro to sort of hopefully give you an intuitive sense of how they work, the mathematics behind them. Um the second one is listed on the class spreadsheet and that is the implementation of a simple fully connected neural network in C++. Um it doesn't matter if you don't know C++. C++ just happens to be the language that he's coding in but it's just like you know just vectors and classes and stuff and so everyone should be able to follow along. But that video is great because it shows you the structure of a neural network, how easy it is to compute a neural network and actually code one
0:49 from scratch. And then the third one is going to be uh a week from now which is the final actual in-class lecture for the term which is on sort of an intro to deep neural networks and what they do differently than simple fully connected neural networks. And so uh I like to start out this lecture with a story that I saw. So whenever I'm uh preparing lectures for my classes, I don't just start from scratch and come up with everything myself. Obviously, I like to watch other people's lectures and see what they've done for a particular topic. And uh so what happened was I was watching the uh MIT intro to AI class and um I can't remember what year that video was from, but he actually told a story in his intro to neural network um
1:39 lecture. I can't remember the prop's name. Um, but he said in in 2010, MIT
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Dave Churchill.