1/21
Looks like no tags are added yet.
Neural Networks
neural network are the foundation of what we consider today to be AI (LLM, so on)
creating the perceptron many decades ago was the biological inspiration for neural networks
inputs
calculates sum of those inputs
based on the threshold, decides whether to fire or not
18 Ă— 18 image
each of those pixels provides some input to the perceptron, it will take the sum of the weight inputs (each input has a weight associated with it) and then the threshold
going beyond the perceptron, adding a hidden layer
instead of going straight form input to output…. input, hidden layer, and then output layer
for each layer, there are arrows between every pixel to every neuron in the hidden layer and then from the hidden layer to the next layer and so on
hidden layers = not visible form the input or the output.

Deep Neural Network
deep model: a neural network containing more than one hidden layer
general rule, the more hidden layers included in a neural network, the more complex patterns it will be able to pick up on
the arrows show all the diff connections points
input layer, arrow to every neuron in next layer….. until output
arrows have weights associated with them and can be billions of weights

Input layer
the layer of a neural network that holds the feature vector. that is, the input provides examples for training or inference
ex: 18 Ă— 18 image, input layer would have 324 feature nodes inside it
Hidden layer
a layer in a neural network between the input layer (features) and the output layer (prediction). each hidden layer consists of one or more neurons
input feeds into one hidden layer → feeds into another hidden layer
variety of numbers of hidden layers
how many neurons to include in a hidden layer also varies by layer. not a particular rule and consistency not needed
Output layer
the “final” layer of a neural network and the output layer contains the prediction
Data and hardware constraints
training neural networks and similar methods to solve problems can be really slow and often do not work well given the limit data and computer power available at the time
SVM (support vector machine) were more popular in the 1990s and early 2000s
more computationally efficient
ImageNet Competition
in 2010 and 2011, SVM based tools won the competition with less than 75% accuracy
in 2012 a deep learning approach called AlexNet won the comp
8 layers
used Graphic Processing Units (GPU) → hardware that allows for neural network training
85% accuracy
by 2015 models could have more than 100 hidden layers
deeper layers encode more complex concepts

Training Neural Networks
process of getting to a set of weights and arrows that are capable of doing all these things
the ability to train these neural networks was one of the big challenges in perceptrons
a perceptron on its own cant do that much need multi layer structure
big challenge in early days
Backpropagation
backpropagation is a learning algorithm for training multi layer neural networks
it is a way to take an error observed at the output unit and to “propagate” the blame for that error backward so as to assign proper blame to each weight in the network
how do we learn from the errors we made to update the system
this allows backpropagation to determine how much to change each weight in order to reduce the error
learning in neural network consists of gradually modifying the weights on connections so each output’s error gets as close to 0 as possible
Neural network “weights”
each arrow represents a weight

Neural network “weights”
weights are the numerical parameters within a neural network that determine the strength of connections between artificial neurons
they shape how the model processes info
during training, weights are continuously adjusted (through algorithms like backpropagation) to minimize errors and improve the model’s prediction
the learned weights represent the model’s “knowledge” - a trained AI model is a specific configruation of billions of these weight values that encode patterns discovered in the training data
Neural networks find non-linear patterns in the data
images are non-linear, for example
the first thing to go into the neural network is a way to pick up on these non-linear patterns.
3 input
3 hidden
1 output
perceptron just created a weighted sum of the outputs. the problem is this only allows us to keep track of linear patterns.
so, one component of a neuron is an activation function.

Activation Function
this was the key for neural networks learning non-linear patterns
it is a function that enables neural networks to learn nonlinear (complex) relationships between feature and label
an activation function is a nonlinear transform of a neuron’s output value before the value is passed as input to the calculations of the next layer of the neural network
ReLU → negative numbers, output 0. positive, output 1.
Sigmoid → squish values so its only between 0 and 1.

Backpropagation part 2
many iterations of the following process
forward pass: the system processes a batch of examples to yield predictions. the system compares each prediction to each label value. the difference between the prediction and label value is the loss for that example. the system aggregates the losses for all the examples to compute the total loss fro that batch.
backward pass (backpropagation): the system reduces loss by adjusting weights of all neurons in hidden layer
operates using gradient descent from calculus
Learning Rate
the learning rate is a multiplier that controls the degree to each backward pass increases or decreases each weight
a large learning rate will increase or decrease each weight more than a small learning rate
it tells gradient descent algorithm how strongly to adjust weight on each iteration (0.3 learning rate adjusts weights/biases 3 times more than 0.1 learning rate)
key hyperparameter. if learning rate too low, training is too long. if learning rate too high, gradient descent has trouble
Loss
loss: during the training of a supervised model, a measure of how far a model’s prediction is from its label
the goal of training is to minimize the loss that a loss function returns
loss function: a math function that calculates the loss on a batch of examples. a loss function returns a lower loss for models that make good predictions than for models that make bad predictions
training loss: a metric representing a model’s loss during particular training iteration..
test loss: a metric representing a model’s loss during test set.
Loss Curve
ideal loss curve
loss goes down over time
starting out, all the weights are randomly generated which is why loss is so high at the beginning

Impacts and Challenges
lack of scientific basis
hard to know ahead of time how many layers of hidden units are needed or how many should be included in a layer
most neural network researchers use a form of trial and error to find the best “settings”
Impacts and Challenges
need large datasets
web scraping without permission
errors, gaps, biases, offensive content
low paid workers often label the data
compensation is often less than $2 per hour
data producers like photographers (images)
Impacts and Challenges
computational hardware
GPUs (often many) are needed to train neural networks
companies like NVIDIA benefited immensely from this boom
parallel processing: a type of computation in which many computations or processes are carried out simultaneously
CPU: central processing unit can have multiple processing cores
GPU: many smaller, more specialized cores. GPU excels at highly parallel tasks
Reliance on Benchmarks
even before ImageNet, only way to get AI innovation take seriously is to achieve really good results on benchmark dataset. ImageNet entrenched this norm
benchmarking is often one-dimensional that may not represent what we want out of AI in the real world