Deep neural networks Flashcards
1
Q
What are the applications of deep neural networks?
A
- Medical, stocks, self driving cars, computer vission, medical diagnosis
2
Q
What are neural networks?
A
- Vaguely mimic the process in which the brain operates, neurons that fire bits of info.
- Simple explanation: There are some red and blue shells in the floor, the neural network draws the line that best separates them. Neural networks given some data in the form of red and blue points it find the line that best separates them
3
Q
boundary line general equation 2d
A
w1x1+w2x2+b+0
4
Q
What is a percepton?
A
- Building block of a neural network
- Encoding of the equation into a small graph
- small nodes x1,…, xn, 1 and their edges w1,…,wn, b
- then linear function node calculates the sum of the multiplication of each small node going into it by its edge.
- then the step function returns a 1 or 0 depending if the result is negative or positive linear function
- Perceptrons as Logical Operators
5
Q
Why are neural networks called like that?
A
- Because it works similarly to a neuron. The percepton gets an input and based on the inputs it returns an output.
- A neuron gets electrical inputs through its dendrites and then decides to emit an electrical pulse or not
6
Q
Perceptron trick?
A
- Punto (4,5) bias = 1
- w1 - 4, w2 -5, bias - 1
7
Q
Perceptron algorithm
A
- Start with random weights: w1, …, wn, b
- For every misclassified point (x1, …, xn): If prediction = 0:
- For i = 1 …n
- Change wi + a xi
- Change b to b + a - For every misclassified point (x1, …, xn): If prediction = 1:
- For i = 1 …n
- Change wi - a xi
- Change b to b - a
8
Q
What is an error function?
A
- Tells us how far we are from the solution
- For Neural nets the result should be continuos not discrete
- The error function should assign a penalty value to each point. More to the incorrectly classified
- We need to move from discrete predictions to continious
9
Q
What is the new perceptron?
A
- Replace the step function with the sigmond function.
- 1 / (1 + e ^ (-x))
- The sigmond will give a greater probability to a big number, 0.5 to 0 and very small probabilities to negative numbers
10
Q
How to do multi-class classification?
A
- We use the softmax function.
11
Q
What is the softmax function?
A
- It helps to translate a score from a function (Linear for example) to a probability.
- You have scores Z1, …, Zn
- P(class i) = e^Zi/(e^Z1+…+e^Zn)
12
Q
What is cross-entropy?
A
- It is used for calculating the maximum likelihood of a model.
- -ln(p1)-ln(p2)
- Goal is to minimize the cross-entropy. Better if the number is small
Formula
yi = 1 if present on box i - sum yiln(pi) + (1-yi)ln(1-pi)
13
Q
Multi-class cross-entropy?
A
- -sum sum yij*ln(pij)
14
Q
Error function
A
- 1/m*sum(i in m) (1-yi)(1-ln(^yi)) + yiln(^yi)
- m is the number of points
15
Q
Why and how to calculate the gradient descent?
A
- The negative of delta E (gradient descent) is the direction to move to decrease the most error
- It is the derivative of the error function by each weight and bias