Neural Networks + Deep Learning (9/21)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/21

encourage image

There's no tags or description

Looks like no tags are added yet.

22 Terms

1
New cards

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.


<p>neural network are the foundation of what we consider today to be AI (LLM, so on)</p><ul><li><p>creating the perceptron many decades ago was the biological inspiration for neural networks</p><ul><li><p>inputs</p></li><li><p>calculates sum of those inputs</p></li><li><p>based on the threshold, decides whether to fire or not </p></li></ul></li><li><p>18 × 18 image </p><ul><li><p>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</p></li></ul></li></ul><p></p><p>going beyond the perceptron, adding a hidden layer</p><ul><li><p>instead of going straight form input to output…. input, hidden layer, and then output layer</p></li><li><p>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</p></li></ul><p></p><p>hidden layers = not visible form the input or the output.</p><p></p>
2
New cards

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


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

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


4
New cards

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


5
New cards

Output layer

  • the “final” layer of a neural network and the output layer contains the prediction


6
New cards

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


7
New cards

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


8
New cards

deeper layers encode more complex concepts

knowt flashcard image
9
New cards

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

10
New cards

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


11
New cards

Neural network “weights”

each arrow represents a weight

<p>each arrow represents a weight</p>
12
New cards

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


13
New cards

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.


<ul><li><p>images are non-linear, for example</p></li><li><p>the first thing to go into the neural network is a way to pick up on these non-linear patterns. </p><ul><li><p>3 input</p></li><li><p>3 hidden</p></li><li><p>1 output</p></li></ul></li><li><p>perceptron just created a weighted sum of the outputs. the problem is this only allows us to keep track of linear patterns.</p></li><li><p>so, one component of a neuron is an activation function.</p></li></ul><p></p>
14
New cards

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.

<ul><li><p>this was the key for neural networks learning non-linear patterns</p></li><li><p>it is a function that enables neural networks to learn nonlinear (complex) relationships between feature and label</p></li><li><p>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 </p></li></ul><p></p><p>ReLU → negative numbers, output 0. positive, output 1.</p><p>Sigmoid → squish values so its only between 0 and 1.</p>
15
New cards

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


16
New cards

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


17
New cards

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.


18
New cards

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

<p>ideal loss curve</p><ul><li><p>loss goes down over time </p></li></ul><p></p><p>starting out, all the weights are randomly generated which is why loss is so high at the beginning</p>
19
New cards

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”


20
New cards

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)


21
New cards

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


22
New cards

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