1. Home
2. Training Library
3. Big Data
4. Courses
5. Getting Started With Deep Learning: Working With Data: Gradient Descent

1
Introduction
PREVIEW1m 22s
3
4
12
13
EWMA
4m 12s
14
17
18
20
22
24
26

## The course is part of these learning paths

AWS Machine Learning – Specialty Certification Preparation
39
14
15
Start course
Overview
Difficulty
Beginner
Duration
1h 45m
Students
603
Ratings
5/5
Description

Learn about the importance of gradient descent and backpropagation, under the umbrella of Data and Machine Learning, from Cloud Academy.

From the internals of a neural net to solving problems with neural networks to understanding how they work internally, this course expertly covers the essentials needed to succeed in machine learning.

Learning Objective

• Understand the importance of gradient descent and backpropagation
• Be able to build your own neural network by the end of the course

Prerequisites

Transcript

Hello, and welcome to this video on gradient descent. In this video, we will learn about different types of gradient descent, and we will learn about the concept of batch, and, in particular, the fact that we need to choose a batch size. How do back propagation and gradient descent work in practice in deep learning? As we've seen, the gradient is calculated from the cost function evaluated on the training data. x and y here indicate a pair of training features and labels. In principle, we could feed the training data one point at a time to the cost function and, for each pair of features and labels, calculate the cost and the gradient and update the weights accordingly. So, one point goes in, we do forward propagation, back propagation, and update the weights. This is called stochastic gradient descent.

Once our model has seen each training data once, we say that an epoch has completed, and we start again from the first training pair with the following epoch. Stochastic gradient descent is a very noisy estimation of the gradient, because a single training data point is used to estimate the gradient. You can improve it by averaging the gradients over the training data before we update the weights. This is how normal gradient descent works. In normal or batch gradient descent, we first calculate the gradient for all training pairs, and then, we average the gradients to update the weights.

While more accurate, this method is also not optimal, since a single update requires calculating the gradients for all the training data, and we basically end up doing one weight update per epoch. A compromise solution is called mini-batch, or mini-batch gradient descent. In this case, we will still average the gradient calculation, but only over a small number of points taken from a sample of the training set.

It's common to take a power of two, so, for example, you could take 16 points, 32 points, 64 points, et cetera. This method gives us the best of both approaches. By averaging a few points, we get a better estimation of the gradient, a less noisy estimation of the gradient, but we also do many updates per epoch, speeding up training in this way. In conclusion, in this video, we've seen that there are three ways of doing gradient descent: normal gradient descent, stochastic gradient descent, and mini-batch gradient descent. For mini-batch, we've learned that there is a choice to be made which the size of the batch we are using for each weight update. Thank you for watching and see you in the next video.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9208957,"math_prob":0.9023355,"size":4062,"snap":"2021-31-2021-39","text_gpt3_token_len":818,"char_repetition_ratio":0.16190241,"word_repetition_ratio":0.011851852,"special_character_ratio":0.19350074,"punctuation_ratio":0.104359314,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96739227,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-18T12:58:08Z\",\"WARC-Record-ID\":\"<urn:uuid:8bf166ee-4258-4d19-b57a-8c3ac196a9b6>\",\"Content-Length\":\"416634\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:2c8eb6fd-62c1-4e57-8d08-401b7a519431>\",\"WARC-Concurrent-To\":\"<urn:uuid:12f45004-bec5-49b1-b4f7-5a77e0dee19e>\",\"WARC-IP-Address\":\"13.249.38.7\",\"WARC-Target-URI\":\"https://cloudacademy.com/course/data-machine-learning-gradient-descent/gradient-descent/\",\"WARC-Payload-Digest\":\"sha1:PRZKKJL2UF3X3GJK6GS6FGUTLI6CYPKM\",\"WARC-Block-Digest\":\"sha1:4KCD5URWIBJHBH6J5TEZ4PFORPTZ3TET\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780056476.66_warc_CC-MAIN-20210918123546-20210918153546-00437.warc.gz\"}"}