Discussing the article: "Neural Networks in Practice: Stochastic Gradient Descent"

Check out the new article: Neural Networks in Practice: Stochastic Gradient Descent.

This article uses practical examples to explain how to calculate and apply gradients of the weights and bias (intercept) in a linear neuron implemented in MQL5, and also discusses a stochastic variant of gradient descent. We analyze stopping criteria, iteration limits, and the effects of training on data subsets. The results are displayed in the MetaTrader 5 terminal, where a simple chart is also plotted. Readers are invited to modify the training set and analyze the model's behavior.

Here's the point: in the previous article, I mentioned that at some point you might have a dataset that can be represented by a blue line. In other words, we have a rather complex polynomial. This polynomial is fed into the neural network so that it can attempt to find an equation capable of describing the data contained in the dataset. So far, I don't think there's anything particularly difficult to understand here. During my explanation, I mention that the points shown in the image represent the magnitude of the error that occurs when the neural network is initialized. And it is precisely this part that may have remained somewhat unclear. I'd like to clarify this issue further.

The thing is, when we plot something—as many of you have probably seen in explanations involving error—the resulting plot usually represents a surface. The problem is that a surface plot requires two variables: one for the X-axis and the other for the Y-axis. The values corresponding to the combination of these variables are plotted on the Z-axis. Something similar to what is shown in the following animation.

This animation shows that as the values along the Z-axis change, each value along the Z-axis corresponds to a combination of one value along the X-axis and another along the Y-axis. However, the curve shown in the image at the beginning of the article cannot be represented as a surface plot; it is impossible even to imagine what such a plot would look like. This is because, obviously, constructing it would require far more than two variables.


Author: Daniel Jose