concept gradient descent in category deep learning

appears as: gradient descent, gradient descent
Probabilistic Deep Learning: With Python, Keras and TensorFlow Probability

This is an excerpt from Manning's book Probabilistic Deep Learning: With Python, Keras and TensorFlow Probability.

Setting up a DL system is always a two-stage process. In the first step, you choose an architecture. In figure 1.1, we choose a network with three layers in which each neuron from a given layer is connected to each neuron on the next layer. Other types of networks have different connections, but the principle stays the same. In the next step, you tune the weights of the model so that the training data is best described. This fitting step is usually done using a procedure called gradient descent. You’ll learn more about gradient descent in chapter 3.

In simple machine learning models, which have a simple loss functions, it’s often possible to provide a formula that allows you to compute the optimal parameter values from the data. Yet, this isn’t the case for complex models. For complex models, sophisticated optimization procedures have been developed over several decades. Deep learning almost exclusively uses an approach to determine the parameters: this is called gradient descent. In this chapter, you’ll see that gradient descent is an astonishingly simple technique. It’s still kind of a miracle that this simple technique works so well in DL, while more advanced procedures for optimization fail.

Take a look at figure 3.5, which shows the dependency of the loss and the parameter a, the slope in our blood pressure example (the intercept was fixed at its optimal value 87.6). The only task remaining is to find the optimal value for parameter a. This is done via gradient descent. In figure 3.5, you can see the development of the a value when starting from a first guess of a1=0.5 , using three different learning rates.

Figure 3.5 The loss from equation 3.1 plotted versus the free regression model parameter a. It shows the results of 5 steps of gradient descent, starting with a = 0.5 with different learning rates. With a learning rate of 0.0001, the minimum is approximately reached in 5 steps without overshooting. With a learning rate of 0.0003, the minimum is also reached after approximately 5 steps but overshooting the position of the minimum twice. With a learning rate of 0.00045, the updates of a always overshoot the position of the minimum. In this case, the updated values for a are more and more apart from the minimum. The corresponding loss grows without bounds.
Deep Learning with JavaScript: Neural networks in TensorFlow.js

This is an excerpt from Manning's book Deep Learning with JavaScript: Neural networks in TensorFlow.js.

Although neural networks are inspired by the brain, we should be careful not to overly humanize them. The purpose of neural networks is not to study or mimic how the brain works. That is the realm of neuroscience, a separate academic discipline. Neural networks are about enabling machines to perform interesting practical tasks by learning from data. The fact that some neural networks show resemblance to some parts of the biological brain, both in structure and in function,[4] is indeed remarkable. But whether this is a coincidence is beyond the scope of this book. In any case, the resemblance should not be overread. Importantly, there is no evidence that the brain learns through any form of gradient descent, the primary way in which neural networks are trained (covered in the next chapter). Many important techniques in neural networks that helped usher in the deep-learning revolution were invented and adopted not because they were backed by neuroscience, but instead because they helped neural networks solve practical learning tasks better and faster.

Figure 2.6. A flowchart illustrating the training loop, which updates the model via gradient descent
  • Gradient descent, the basic algorithm structure behind deep learning, is conceptually simple and really just means repeatedly updating model parameters in small steps in the calculated direction that would most improve the model fit.
  • 2.2.2. Backpropagation: Inside gradient descent

    In the previous section, we explained how the step size of weight updates affects the process of gradient descent. However, we haven’t discussed how the directions of the updates are computed. The directions are critical to the neural network’s learning process. They are determined by the gradients with respect to the weights, and the algorithm for computing the gradients is called backpropagation. Invented in the 1960s, backpropagation is one of the foundations of neural networks and deep learning. In this section, we will use a simple example to show how backpropagation works. Note that this section is for readers who wish to get an understanding of backpropagation. It is not necessary if you only wish to apply the algorithm using TensorFlow.js, because these mechanisms are all hidden nicely under the tf.Model.fit() API; you may skip this section and continue reading at section 2.3.

    Grokking Deep Learning

    This is an excerpt from Manning's book Grokking Deep Learning.

    Finding the appropriate alpha, even for state-of-the-art neural networks, is often done by guessing. You watch the error over time. If it starts diverging (going up), then the alpha is too high, and you decrease it. If learning is happening too slowly, then the alpha is too low, and you increase it. There are other methods than simple gradient descent that attempt to counter for this, but gradient descent is still very popular.

    Gradient descent generalizes to arbitrarily large networks

    Gradient descent is a general learning algorithm

    Perhaps the most important subtext of this chapter is that gradient descent is a very flexible learning algorithm. If you combine weights in a way that allows you to calculate an error function and a delta, gradient descent can show you how to move the weights to reduce the error. We’ll spend the rest of this book exploring different types of weight combinations and error functions for which gradient descent is useful. The next chapter is no exception.