-
Book Overview & Buying
-
Table Of Contents
The Deep Learning Workshop
By :
Let's solve the following quadratic equation:
Figure 1.29: Quadratic equation to be solved
We already know that the solution to this quadratic equation is x=5.
We can use an optimizer to solve this. For the optimizer, x is the variable and the cost function is the left-hand side expression, which is as follows:
Figure 1.30: Left-hand side expression
The optimizer will find the value of x for which the expression is the minimum – in this case, it is 0. Please note that this will work only for quadratic equations that are perfect squares, such as in this case. The left-hand side expression is a perfect square that can be explained with the following equation:
Figure 1.31: Perfect square
Now, let's look at the code for solving this: