Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
257
7.04k
Cour se summar y Here are the course summary as its given on the course link: If you want to break into cutting-edge AI, this course will help you do so. Deep learning engineers are highly sought after, and mastering deep learning will give you numerous new career opportunities. Deep learning is also a new "superpower"...
Deep NN consists of more hidden layers (Deeper layers) Image taken from opennn. net Each Input will be connected to the hidden layer and the NN will decide the connections. Supervised learning means we have the (X,Y) and we need to get the function that maps X to Y. Super vised learning with neural netw orks Different ...
Neural Netw orks Basics Learn to set up a machine learning problem with a neural network mindset. Learn to use vectorization to speed up your models. Binar y classification Mainly he is talking about how to do a logistic regression to make a binary classifier. Image taken from 3. bp. blogspot. com He talked about an ex...
The actual equations we will implement: w = w-alpha * d(J(w,b) / dw) (how much the function slopes in the w direction) b = b-alpha * d(J(w,b) / db) (how much the function slopes in the d direction) Deriv atives We will talk about some of required calculus. You don't need to be a calculus geek to master deep learning bu...
Gradient Descent on m Examples Lets say we have these variables: X1 Feature X2 Feature W1 Weight of the first feature. W2 Weight of the second feature. B Logistic Regression parameter. M Number of training examples Y(i) Expected output of i So we have: Then from right to left we will calculate derivations compared to t...
Num Py library (dot) function is using vectorization by default. The vectorization can be done on CPU or GPU thought the SIMD operation. But its faster on GPU. Whenever possible avoid for loops. Most of the Num Py library methods are vectorized version. Vectorizing Logistic R egression We will implement Logistic R egre...
kaggle. com is a good place for datasets and competitions. Pieter Abbeel is one of the best in deep reinforcement learning. Shallow neural netw orks Learn to build a neural network with one hidden layer, using forward propagation and backpropagation. Neural Netw orks Ov erview In logistic regression we had: X1 \ X2 ==>...
Pseudo code for forward propagation for the 2 layers NN: for i = 1 to m z[1, i] = W1*x[i] + b1 # shape of z[1, i] is (no Of Hidden Neurons,1) a[1, i] = sigmoid(z[1, i]) # shape of a[1, i] is (no Of Hidden Neurons,1) z[2, i] = W2*a[1, i] + b2 # shape of z[2, i] is (1,1) a[2, i] = sigmoid(z[2, i]) # shape of a[2, i] is (...
g(z) = (e^z-e^-z) / (e^z + e^-z) g'(z) = 1-np. tanh(z)^2 = 1-g(z)^2 Derivation of REL U activation function: g(z) = np. maximum(0,z) g'(z) = { 0 if z < 0 1 if z >= 0 } Derivation of leaky REL U activation function: g(z) = np. maximum(0. 01 * z, z) g'(z) = { 0. 01 if z < 0 1 if z >= 0 } Gradient descent for Neural Netw ...
How we derived the 6 equations of the backpropagation: Random Initialization In logistic regression it wasn't important to initialize the weights randomly, while in NN we have to initialize them randomly. If we initialize all the weights with zeros in NN it won't work (initializing bias with zero is OK): all hidden uni...
z[l] = W[l]a[l-1] + b[l] a[l] = g[l](a[l]) Forward propagation general rule for m inputs: Z[l] = W[l]A[l-1] + B[l] A[l] = g[l](A[l]) We can't compute the whole layers forward propagation without a for loop so its OK to have a for loop here. The dimensions of the matrices are so important you need to figure it out. Gett...
Forward and Backwar d Propagation Pseudo code for forward propagation for layer l: Input A[l-1] Z[l] = W[l]A[l-1] + b[l] A[l] = g[l](Z[l]) Output A[l], cache(Z[l]) Pseudo code for back propagation for layer l: Input da[l], Caches d Z[l] = d A[l] * g'[l](Z[l]) d W[l] = (d Z[l]A[l-1]. T) / m db[l] = sum(d Z[l])/m # Dont ...
Training a Softmax classifier Deep learning frameworks Tensor Flow Extra Notes Cour se summar y Here are the course summary as its given on the course link: This course will teach you the "magic" of getting deep learning to work well. Rather than the deep learning process being a black box, you will understand what dri...
Another idea to get the bias / variance if you don't have a 2D plotting mechanism: High variance (overfitting) for example: Training error: 1% Dev error: 11% high Bias (underfitting) for example: Training error: 15% Dev error: 14% high Bias (underfitting) && High variance (overfitting) for example: Training error: 15% ...
The normal cost function that we want to minimize is: J(W1,b1...,WL,b L) = (1/m) * Sum(L(y(i),y'(i))) The L2 regularization version: J(w,b) = (1/m) * Sum(L(y(i),y'(i))) + (lambda/2m) * Sum((||W[l]||^2) We stack the matrix as one vector (mn,1) and then we apply sqrt(w1^2 + w2^2..... ) To do back propagation (old way): d...
Dropout can have different keep_prob per layer. The input layer dropout has to be near 1 (or 1-no dropout) because you don't want to eliminate a lot of features. If you're more worried about some layers overfitting than others, you can set a lower keep_prob for some layers than others. The downside is, this gives you e...
iii. Get the variance of the training set: variance = (1/m) * sum(x(i)^2) iv. Normalize the variance. X /= variance These steps should be applied to training, dev, and testing sets (but using mean and variance of the train set). Why normalize? If we don't normalize the inputs our cost function will be deep and its shap...
There is an technique called gradient checking which tells you if your implementation of backpropagation is correct. There's a numerical way to calculate the derivative: Gradient checking approximates the gradients and is very helpful for finding the errors in your backpropagation implementation but it's slower than gr...
Obser vations : The value of λ is a hyperparameter that you can tune using a dev set. L2 regularization makes your decision boundary smoother. If λ is too large, it is also possible to "oversmooth", resulting in a model with high bias. What is L2-r egularization actually doing? : L2-regularization relies on the assumpt...
iteration). Mini-batch size: (mini batch size = m) ==> Batch gradient descent (mini batch size = 1) ==> Stochastic gradient descent (SGD) (mini batch size = between 1 and m) ==> Mini-batch gradient descent Batch gradient descent: too long per iteration (epoch) Stochastic gradient descent: too noisy regarding cost minim...
Best beta average for our case is between 0. 9 and 0. 98 Another imagery example: (taken from investopedia. com ) Under standing exponentially w eight ed av erages Intuitions: We can implement this algorithm with more accurate results using a moving window. But the code is more efficient and faster using the exponentia...
vd W = beta * vd W + (1-beta) * d W vdb = beta * vdb + (1-beta) * db W = W-learning_rate * vd W b = b-learning_rate * vdb Momentum helps the cost function to go to the minimum point in a more fast and consistent way. beta is another hyperparameter. beta = 0. 9 is very common and works very well in most cases. In pract...
W = W-learning_rate * vd W / (sqrt(sd W) + epsilon) b = B-learning_rate * vdb / (sqrt(sdb) + epsilon) Hyperparameters for Adam: Learning rate: needed to be tuned. beta1: parameter of the momentum-0. 9 is recommended by default. beta2: parameter of the RMSprop-0. 999 is recommended by default. epsilon: 10^-8 is recomme...
Calculate: b_log = log(b) # e. g. b = 1 then b_log = 0 Then: r = (a_log-b_log) * np. random. rand() + b_log # In the example the range would be from [-4, 0] because rand range [0,1) result = 10^r It uniformly samples values in log scale from [a,b]. If we want to use the last method on exploring on the "momentum beta": ...
Batch normalization is usually applied with mini-batches. If we are using batch normalization parameters b[1],..., b[L] doesn't count because they will be eliminated after mean subtraction step, so: Z[l] = W[l]A[l-1] + b[l] => Z[l] = W[l]A[l-1] Z_norm[l] =... Z_tilde[l] = gamma[l] * Z_norm[l] + beta[l] Taking the mean ...
Training a So ftmax classifier There's an activation which is called hard max, which gets 1 for the maximum value and zeros for the others. If you are using Num Py, its np. max over the vertical axis. The Softmax name came from softening the values and not harding them like hard max. Softmax is a generalization of logi...
In this section we will learn the basic structure of T ensor Flow programs. Lets see how to implement a minimization function: Example function: J(w) = w^2-10w + 25 The result should be w = 5 as the function is (w-5)^2 = 0 Code v. 1: Code v. 2 (we feed the inputs to the algorithm through coefficients): import numpy as ...
Instead of needing to write code to compute the cost function we know, we can use this line in T ensor Flow : tf. nn. sigmoid_cross_entropy_with_logits(logits =..., labels =... ) To initialize weights in NN using T ensor Flow use: W1 = tf. get_variable("W1", [25,12288], initializer = tf. contrib. layers. xavier_initial...
Be able to prioritize the most promising directions for reducing error Understand complex ML settings, such as mismatched training/test sets, and comparing to and/or surpassing human-level performance Know how to apply end-to-end learning, transfer learning, and multi-task learning I've seen teams waste months or years...
Classifier Precision Recall Classifier Precision Recall A 95% 90% B 98% 85% A better thing is to combine precision and recall in one single (real) number evaluation metric. There a metric called F1 score, which combines them You can think of F1 score as an average of precision and recall F1 = 2 / ((1/P) + (1/R)) Satisf...
Conclusion: if doing well on your metric + dev/test set doesn't correspond to doing well in your application, change your metric and/or dev/test set. Why human-lev el per formance? We compare to human-level performance because of two main reasons: i. Because of advances in deep learning, machine learning algorithms are...
iii. Dev error So having an estimate of human-level performance gives you an estimate of Bayes error. And this allows you to more quickly make decisions as to whether you should focus on trying to reduce a bias or trying to reduce the variance of your algorithm. These techniques will tend to work well until you surpass...
Image Dog Great Cats blurr y Instagram filt ers Comments 4 ✓.... % totals 8% 43% 61% 12% In the last example you will decide to work on great cats or blurry images to improve your performance. This quick counting procedure, which you can often do in, at most, small numbers of hours can really help you make much better ...
Example: the cat classification example. Suppose you've worked in the example and reached this Human error: 0% Train error: 1% Dev error: 10% In this example, you'll think that this is a variance problem, but because the distributions aren't the same you can't tell for sure. Because it could be that train set was easy ...
When transfer learning make sense: Task A and B have the same input X (e. g. image, audio). You have a lot of data for the task A you are transferring from and relatively less data for the task B your transferring to. Low level features from task A could be helpful for learning task B. Multi-task learning Whereas in tr...
Here end-to-end deep leaning system works better because we have enough data to build it. Example 4: Estimating child's age from the x-ray picture of a hand: Image--> Bones--> Age # non-end-to-end system-best approach for now Image------------> Age # end-to-end system In this example non-end-to-end system works better ...
One Shot Learning Siamese Network Triplet Loss Face V erification and Binary Classification Neural S tyle T ransfer What is neural style transfer? What are deep Conv Nets learning? Cost Function Content Cost Function Style Cost Function 1D and 3D Generalizations Extras Keras Cour se summar y Here is the course summary ...
Early layers of CNN might detect edges then the middle layers will detect parts of objects and the later layers will put the these parts together to produce an output. In an image we can detect vertical edges, horizontal edges, or full edge detector. Vertical edge detection: An example of convolution operation to detec...
So the problems with convolutions are: Shrinks output. throwing away a lot of information that are in the edges. To solve these problems we can pad the input image before convolution by adding some rows and columns to it. W e will call the padding amount P the number of row/columns that we will insert in top, bottom, l...
Input image: 6x6x3 # a0 10 Filters: 3x3x3 #W1 Result image: 4x4x10 #W1a0 Add b (bias) with 10x1 will get us : 4x4x10 image #W1a0 + b Apply REL U will get us: 4x4x10 image #A1 = RELU(W1a0 + b) In the last result p=0, s=1 Hint number of parameters here are: (3x3x3x10) + 10 = 280 The last example forms a layer in the CNN....
This example has f = 2, s = 2, and p = 0 hyperparameters The max pooling is saying, if the feature is detected anywhere in this filter then keep a high number. But the main reason why people are using pooling because its works well in practice and reduce computations. Max pooling has no parameters to learn. Example of ...
Hyperparameters are a lot. For choosing the value of each you should follow the guideline that we will discuss later or check the literature and takes some ideas and numbers from it. Usually the input size decreases over layers while the number of filters increases. A CNN usually consists of one or more convolution (No...
Reading and trying the mentioned models can boost you and give you a lot of ideas to solve your task. Classic netw orks In this section we will talk about classic networks which are Le Net-5, Alex Net, and VGG. Le Net-5 The goal for this model was to identify handwritten digits in a 32x32x1 gray image. Here are the dra...
Here are the architecture: This network is large even by modern standards. It has around 138 million parameters. Most of the parameters are in the fully connected layers. It has a total memory of 96MB per image for only forward propagation! Most memory are in the earlier layers. Number of filters increases from 64 to 1...
On the left is the normal NN and on the right are the R es Net. As you can see the performance of R es Net increases as the network goes deeper. In some cases going deeper won't effect the performance and that depends on the problem on your hand. Some people are trying to train 1000 layer now which isn't used in practi...
All the 3x3 Conv are same Convs. Keep it simple in design of the network. spatial size /2 => # filters x2 No FC layers, No dropout is used. Two main types of blocks are used in a R es Net, depending mainly on whether the input/output dimensions are same or different. Y ou are going to implement both of them. The dotted...
Taken from icml. cc/2016/tutorials/icml2016_tutorial_deep_residual_networks_kaiminghe. pdf Residual blocks types: Identity block: Hint the conv is followed by a batch norm BN before RELU. Dimensions here are same. This skip is over 2 layers. The skip connection can jump n connections where n>2 This drawing represents K...
If we have specified the number of 1 x 1 Conv filters to be the same as the input number of channels then the output will contain the same number of channels. Then the 1 x 1 Conv will act like a non linearity and will learn non linearity operator. Replace fully connected layers with 1 x 1 convolutions as Y ann Le Cun b...
Example of inception model in K eras: Inception netw ork (Google Net) The inception network consist of concatenated blocks of the Inception module. The name inception was taken from a meme image which was taken from Inception movie Here are the full model:
Some times a Max-P ool block is used before the inception module to reduce the dimensions of the inputs. There are a 3 Sofmax branches at different positions to push the network toward its goal. and helps to ensure that the intermediate features are good enough to the network to learn and it turns out that softmax0 and...
If you see a research paper and you want to build over it, the first thing you should do is to look for an open source implementation for this paper. Some advantage of doing this is that you might download the network implementation along with its parameters/weights. The author might have used multiple GPUs and spent s...
If you don't have that much data people tend to try more hand engineering for the problem "Hacks". Like choosing a more complex NN architecture. Because we haven't got that much data in a lot of computer vision problems, it relies a lot on hand engineering. We will see in the next chapter that because the object detect...
Object det ection : Given an image we want to detect all the object in the image that belong to a specific classes and give their location. An image can contain more than one object with different classes. Semantic Segmentation : We want to Label each pixel in the image with a category label. Semantic Segmentation Don'...
To make image classification we use a Conv Net with a Softmax attached to the end of it. To make classification with localization we use a Conv Net with a softmax attached to the end of it and a four numbers bx, by, bh, and bw to tell you the location of the class in the image. The dataset should contain this four numb...
Y = [ THere Is Aface # Probability of face is presented 0 or 1 l1x, l1y, ...., l64x, l64y ] Another application is when you need to get the skeleton of the person using different landmarks/points in the person which helps in some applications. Hint, in your labeled data, if l1x,l1y is the left corner of left eye, all o...
As you can see in the above image, we turned the FC layer into a Conv layer using a convolution with the width and height of the filter is the same as the width and height of the input. Conv olution implementation o f sliding windows : First lets consider that the Conv net you trained is like this (No FC all is conv la...
In red, the rectangle we want and in blue is the required car rectangle. Bounding Bo x Predictions A better algorithm than the one described in the last section is the YOLO algorithm. YOLO stands for you only look once and was developed back in 2015. Yolo Algorithm: i. Lets say we have an image of 100 X 100 ii. Place a...
The red is the labeled output and the purple is the predicted output. To compute Intersection Over Union we first compute the union area of the two rectangles which is "the first rectangle + second rectangle" Then compute the intersection area between these two rectangles. Finally IOU = intersection area / Union area I...
In practice this happens rarely. The idea of Anchor boxes helps us solving this issue. If Y = [Pc, bx, by, bh, bw, c1, c2, c3] Then to use two anchor boxes like this: Y = [Pc, bx, by, bh, bw, c1, c2, c3, Pc, bx, by, bh, bw, c1, c2, c3] We simply have repeated the one anchor Y. The two anchor boxes you choose should be ...
An example: We first initialize all of them to zeros and ?, then for each label and rectangle choose its closest grid point then the shape to fill it and then the best anchor point based on the IOU. so that the shape of Y for one image should be [Height Of Grid, Width Of Grid,16] Train the labeled images on a Conv net....
YOLO are not good at detecting smaller object. YOLO9000 Better, faster, stronger Summary: ________________________________________________________________________________________ Layer (type) Output Shape Param # Connected to ======================================================================================== input...
max_pooling2d_4 (Max Pooling2D) (None, 38, 38, 256) 0 leaky_re_lu_8[0][0] ________________________________________________________________________________________ conv2d_9 (Conv2D) (None, 38, 38, 512) 1179648 max_pooling2d_4[0][0] ________________________________________________________________________________________ ...
conv2d_22 (Conv2D) (None, 19, 19, 1024) 11796480 concatenate_1[0][0] ________________________________________________________________________________________ batch_normalization_22 (Batch Nor (None, 19, 19, 1024) 4096 conv2d_22[0][0] ______________________________________________________________________________________...
[Wei Liu, et. al 2015 SSD: Single Shot Multi Box Detector] R-FCN is similar to F aster R-CNN but more efficient. [Jifeng Dai, et. al 2016 R-FCN: Object Detection via R egion-based Fully Convolutional Networks ] Special applications: F ace r ecognition & Neural style transfer Discover how CNNs can be applied to multiple...
The loss function will be d(x1, x2) = || f(x1)-f(x2) ||^2 If X1, X2 are the same person, we want d to be low. If they are different persons, we want d to be high. [Taigman et. al., 2014. Deep F ace closing the gap to human level performance] Triplet Loss Triplet Loss is one of the loss functions we can use to solve the...
When a new image that needs to be compared, get its vector f(x(i)) then put it with all the pre computed vectors and pass it to the sigmoid function. This version works quite as well as the triplet loss function. Available implementations for face recognition using deep learning includes: Openface Face Net Deep F ace N...
From A guide to receptive field arithmetic for Convolutional Neural Networks Cost Function We will define a cost function for the generated image that measures how good it is. Give a content image C, a style image S, and a generated image G: J(G) = alpha * J(C,G) + beta * J(S,G) J(C, G) measures how similar is the gene...
Let a(c)[l] and a(G)[l] be the activation of layer l on the images. If a(c)[l] and a(G)[l] are similar then they will have the same content J(C, G) at a layer l = 1/2 || a(c)[l]-a(G)[l] ||^2 Style Cost Function Meaning of the style of an image: Say you are using layer l's activation to measure style. Define style as co...
So far we have used the Conv nets for images which are 2D. Conv nets can work with 1D and 3D data as well. An example of 1D convolution: Input shape (14, 1) Applying 16 filters with F = 5, S = 1 Output shape will be 10 X 16 Applying 32 filters with F = 5, S = 1 Output shape will be 6 X 32 The general equation (N-F)/S +...
You can add a validation set while training too. iv. Test the model on test data by calling model. evaluate(x =..., y =... ) Summarize of step in K eras: Create->Compile->Fit/T rain->Evaluate/T est Model. summary() gives a lot of useful informations regarding your model including each layers inputs, outputs, and number...
Speech recognition-Audio data Speech recognition Trigger W ord Detection Extras Machine translation attention model (From notebooks) Cour se summar y Here are the course summary as its given on the course link: This course will teach you how to build models for natural language, audio, and other sequence data. Thanks t...
Y: 1 1 0 1 1 0 0 0 0 Both elements has a shape of 9. 1 means its a name, while 0 means its not a name. We will index the first element of x by x, the second x and so on. x = Harry x = Potter Similarly, we will index the first element of y by y, the second y and so on. y = 1 y = 1 T is the size of the input sequence and...
Lets build a RNN that solves name entity r ecognition task: In this problem T = T. In other problems where they aren't equal, the RNN architecture may be different. a is usually initialized with zeros, but some others may initialize it randomly in some cases. There are three weight matrices here: W, W, and W with shape...
Simplified RNN notation : w is w and w stacked horizontally. [a, x ] is a and x stacked vertically. w shape: (No Of Hidden Neurons, No Of Hidden Neurons + n ) [a, x ] shape: (No Of Hidden Neurons + n, 1) Backpr opagation thr ough time Let's see how backpropagation works with the RNN architecture. Usually deep learning ...
The ideas in this section was inspired by Andrej Karpathy blog. Mainly this image has all types: The architecture we have descried before is called Many t o Many. In sentiment analysis problem, X is a text while Y is an integer that rangers from 1 to 5. The RNN architecture for that is Many t o One as in Andrej Karpath...
Let's say we are solving a speech recognition problem and someone says a sentence that can be interpreted into to two sentences: The apple and pair salad The apple and pear salad Pair and pear sounds exactly the same, so how would a speech recognition application choose from the two. That's where the language model com...
Cons: a. The main disadvantage is that you end up with much longer sequences. b. Character-level language models are not as good as word-level language models at capturing long range dependencies between how the the earlier parts of the sentence also affect the later part of the sentence. c. Also more computationally e...
Extra : Solutions for the Exploding gradient problem: Truncated backpropagation. Not to update all the weights in the way back. Not optimal. Y ou won't update all the weights. Gradient clipping. Solution for the V anishing gradient problem: Weight initialization. Like He initialization. Echo state networks. Use LSTM/GR...
Splitting the words and get values of C and U at each place: Word Updat e gat e(U) Cell memor y (C) The 0 val cat 1 new_val which 0 new_val already 0 new_val... 0 new_val was 1 (I don't need it anymore) newer_val full.... Drawing for the GRUs Drawings like in http://colah. github. io/posts/2015-08-Understanding-LSTMs/ ...
Here are the equations of an LSTM unit: In GRU we have an update gate U, a relevance gate r, and a candidate cell variables C while in LSTM we have an update gate U (sometimes it's called input gate I), a forget gate F, an output gate O, and a candidate cell variables C Drawings (inspired by http://colah. github. io/po...
The disadvantage of Bi RNNs that you need the entire sequence before you can process it. For example, in live speech recognition if you use Bi RNNs you will need to wait for the person who speaks to stop to take the entire sequence and then make your predictions. Deep RNNs In a lot of cases the standard one layer RNNs ...
So, instead of a one-hot presentation, won't it be nice if we can learn a featurized representation with each of these words: man, woman, king, queen, apple, and orange?  -Each word will have a, for example, 300 features with a type of float point number. Each word column will be a 300-dimensional vector which will be ...
iii. Optional: continue to finetune the word embeddings with new data. You bother doing this if your smaller training set (from step 2) is big enough. Word embeddings tend to make the biggest difference when the task you're trying to carry out has a relatively smaller training set. Also, one of the advantages of using ...
It turns out that e is the best solution here that gets the the similar vector. Cosine similarity-the most commonly used similarity function: Equation: Cosine Similarity(u, v) = u. v / ||u|| ||v|| = cos(θ) The top part represents the inner product of u and v vectors. It will be large if the vectors are very similar. Yo...
This model was build in 2003 and tends to work pretty decent for learning word embeddings. In the last example we took a window of 6 words that fall behind the word that we want to predict. There are other choices when we are trying to learn word embeddings. Suppose we have an example: "I want a glass of orange juice t...
One of the solutions for the last problem is to use " Hierar chical so ftmax classifier " which works as a tree classifier. In practice, the hierarchical softmax classifier doesn't use a balanced tree like the drawn one. Common words are at the top and less common are at the bottom. How to sample the context c? One way...
We can sample according to empirical frequencies in words corpus which means according to how often different words appears. But the problem with that is that we will have more frequent words like the, of, and... The best is to sample with this equation (according to authors): Glo V e word vectors Glo V e is another al...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
10