Deep Learning Goes Beyond "Import Tensorflow" (Part 1)

2019-11-23

Nowadays, tools like Pytorch and TensorFlow have made AI development so easy that many newcomers in the field are even too lazy to learn how neural networks work. When such conversations are happening, I really wish I was exaggerating. Clearly, this is a problem. If you are new to AI, don't be that person on the right. It gives you and me a bad reputation. But more importantly, when you "use deep learning," you need to understand the algorithms at work. The fact is, if you work in AI, you won't be hand-coding a neural network every time you create one. If you look into the real-world applications of AI - like YouTube's recommendation system or Snapchat's face filters - libraries like TensorFlow and Pytorch are common. This is because these libraries are complex, easy to use, and efficient. But even so, if you don't understand how they work, you won't know much. You won't be able to develop your own deep learning algorithms or models, and you won't know how to adjust or improve existing algorithms or models. So how does deep learning work? Is it not just a flexible way to import libraries, but a mathematical concept? Well, buckle up, brother, we're diving in. How did deep learning come about? While AI has been a hot topic among scientists from the 1950s to the 1980s, the industry only started booming in the past 20 years. This recent popularity can be attributed to the breakthroughs in deep learning by Professor Geoffrey Hinton from the University of Toronto, as well as the exponential growth in computing power and available data. Deep learning is a subset of AI that uses algorithms to mimic the human brain, known as neural networks. The emergence of deep learning, better hardware, and more data has enabled the development of previously unimaginable technologies. These include real-time object detection and classification algorithms, autonomous driving cars, stock market prediction models, generative design software, and more. The basic structure of a neural network Essentially, a neural network learns the relationship between input variables and output variables. Given a sufficient amount of data for a set of x and y, the neural network learns to accurately map x to y. A neural network consists of interconnected layers of processing units. These elements are called "nodes" or "neurons," and they work together to solve complex problems. Nodes are organized into layers, which are further divided into three main types: input layer, hidden layer, and output layer. Nodes in the input layer receive input values, nodes in the hidden layer perform hidden computations, and nodes in the output layer return the network's predictions. Let's say we are training our network to recognize handwritten digits in a 16x16 pixel grid. To receive input from the image, we would allocate 16x16 or 256 nodes for the input layer. Starting from the top left corner of the image, each pixel is represented by a node. The input nodes would contain a value between -1 and 1 to represent the brightness of their corresponding pixels, where -1 is dark and 1 is white. When these values are input into the network, they propagate forward from one layer of neurons to the next. After a series of computations in the hidden layer, we expect to receive 10 outputs, where each output node represents a digit from 0 to 9. For example, if we show the network a handwritten "4," the network should classify our image as "4." Mathematically, the node corresponding to the digit "4" would return the highest value in the output layer. In summary, nodes in the input layer receive input values, nodes in the hidden layer perform computations, and nodes in the output layer return predictions. Understanding a single node! ⚪ The biggest question is, how does our neural network establish relationship models? To understand how a neural network works, we must first understand the function of a single node in the hidden layer. We can compare the function of a single node to a landmark model in statistics - linear regression. Linear regression can be defined as an attempt to model a linear relationship. Suppose you have a set of data that includes two quantitative variables: If you compare students' scores with the number of hours they study in a scatter plot, you will find a positive linear relationship. In general, the longer students spend studying, the higher their chances of scoring well on exams. Linear regression attempts to simulate this linear relationship by drawing the most appropriate line on the scatter plot, which we call the linear model. The linear model is essentially a straight line, y = mx + b, that passes through as many data points as possible. The ideal linear model would minimize the error between the actual scores of students and the predicted scores by the model, or minimize the error between the actual y values and the predicted y values by the model. Let's take a closer look at the math. In a linear model, the input x is multiplied by a constant m and then added to an input b, called the "intercept." These inputs are added together to get the output y. The resulting line y = mx + b simulates the relationship between x and y. If we want to modify the values of the inputs, we need a different line. For example, changing the constant b from 2 to 3 means shifting the line upward, so it intersects the y-axis at y = 3 instead of y = 2. I spent so much time reviewing ninth-grade math with you for a simple reason. The way a single neuron works is exactly the same! In a neuron, the input x₁ is multiplied by a weight w₁. When we multiply the input x₁ by w₁, we call it the "weighted input." Then we add a constant b₁ - its behavior is similar to the y-intercept in a linear model, called the "bias." We then add the weighted input and the bias to get our output, v₀. Alright! A basic neuron. Again, we can adjust the value of v₀ by adjusting the weight w₁ or the bias b₁. If we modify either of these parameters, we would expect to see a different linear model. Original article link: https://medium.com/datadriveninvestor/deep-learning-is-not-just-import-tensorflow-c27136aaa65e

RECENT AI NEWS

RECENT AI TOOLS