- Python Reinforcement Learning Projects
- Sean Saito Yang Wenzhuo Rajalingappaa Shanmugamani
- 470字
- 2021-07-23 19:05:02
Backpropagation
As mentioned previously, a neural network's performance depends on how good the values of W are (for simplicity, we will refer to both the weights and biases as W). When the whole network grows in size, it becomes untenable to manually determine the optimal weights for each neuron in every layer. Therefore, we rely on backpropagation, an algorithm that iteratively and automatically updates the weights of every neuron.
To update the weights, we first need the ground truth, or the target value that the neural network tries to output. To understand what this ground truth could look like, we formulate a sample problem. The MNIST dataset is a large repository of 28x28 images of handwritten digits. It contains 70,000 images in total and serves as a popular benchmark for machine learning models. Given ten different classes of digits (from zero to nine), we would like to identify which digit class a given images belongs to. We can represent the ground truth of each image as a vector of length 10, where the index of the class (starting from 0) is marked as 1 and the rest are 0s. For example, an image, x, with a class label of five would have the ground truth of , where y is the target function we approximate.
What should the neural network look like? If we take each pixel in the image to be an input, we would have 28x28 neurons in the input layer (every image would be flattened to become a 784-dimensional vector). Moreover, because there are 10 digit classes, we have 10 neurons in the output layer, each neuron producing a sigmoid activation for a given class. There can be an arbitrary number of neurons in the hidden layers.
Let f represent the sequence of transformations that the neural network computes, parameterized by the weights, W. f is essentially an approximation of the target function, y, and maps the 784-dimensional input vector to a 10 dimensional output prediction. We classify the image according to the index of the largest sigmoid output.
Now that we have formulated the ground truth, we can measure the distance between it and the network's prediction. This error is what allows the network to update its weights. We define the error function E(W) as follows:
The goal of backpropagation is to minimize E by finding the right set of W. This minimization is an optimization problem whereby we use gradient descent to iteratively compute the gradients of E with respect to W and propagate them through the network starting from the output layer.
Unfortunately, an in-depth explanation of backpropagation is outside the scope of this introductory chapter. If you are unfamiliar with this concept, we highly encourage you to study it first.
- Photoshop CS4經典380例
- Mastering Salesforce CRM Administration
- 工業機器人工程應用虛擬仿真教程:MotoSim EG-VRC
- Photoshop CS3特效處理融會貫通
- Photoshop CS3圖像處理融會貫通
- 系統安裝與重裝
- 自動控制理論(非自動化專業)
- 運動控制器與交流伺服系統的調試和應用
- Splunk Operational Intelligence Cookbook
- Storm應用實踐:實時事務處理之策略
- PVCBOT機器人控制技術入門
- 在實戰中成長:C++開發之路
- INSTANT VMware vCloud Starter
- MATLAB-Simulink系統仿真超級學習手冊
- 青少年VEX IQ機器人實訓課程(初級)