{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "(ch3)=\n", "# Gradient Descent: Part I" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One cannot overstate the importance of 'Gradient descent' in the field of machine learning. It's an optimization technique that lies in the heart of machine learning algorithms ranging from regression to deep learning. This chapter aims to provide intuition behind the gradient descent algorithm and its variant. Similar to previous chapters, I work through examples and code to build a concrete understanding of the concept. \n", "\n", "## Finding Minimum Using Brute Force\n", "Assume a two dimensional function $f(X)=x_0^2 + x_1^2$. Now let's assume we want to find the value of $X=(x_0, x_1)$ at which f(X) is minimum. The natural instinct would be to plot the function for some random range of X and observe the behavior of $f(X)$. Using plotly, below code snippet renders the above function. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2020-05-19T23:26:32.026408Z", "start_time": "2020-05-19T23:26:31.206213Z" } }, "outputs": [ { "data": { "text/html": [ "
| \n", " | x0 | \n", "x1 | \n", "fx | \n", "
|---|---|---|---|
| 0 | \n", "-50.0 | \n", "-49.0 | \n", "4901.0 | \n", "
| 1 | \n", "-49.0 | \n", "-50.0 | \n", "4901.0 | \n", "
| 2 | \n", "-50.0 | \n", "-48.0 | \n", "4804.0 | \n", "
| 3 | \n", "-48.0 | \n", "-50.0 | \n", "4804.0 | \n", "