From 846c90f87e61a0eeee443a81f8e03cf692922ae1 Mon Sep 17 00:00:00 2001 From: skylee03 <1178715749@qq.com> Date: Mon, 17 Jun 2024 13:49:27 +0800 Subject: [PATCH] feat: update Chapter 12 --- docs/12-autodiff.md | 20 +++++++++--------- ...bra-export.webp => geogebra-export-0.webp} | Bin ...export (1).webp => geogebra-export-1.webp} | Bin ...export (2).webp => geogebra-export-2.webp} | Bin ...export (3).webp => geogebra-export-3.webp} | Bin ...export (4).webp => geogebra-export-4.webp} | Bin ...export (5).webp => geogebra-export-5.webp} | Bin ...export (6).webp => geogebra-export-6.webp} | Bin ...export (7).webp => geogebra-export-7.webp} | Bin ...export (8).webp => geogebra-export-8.webp} | Bin 10 files changed, 10 insertions(+), 10 deletions(-) rename static/pics/{geogebra-export.webp => geogebra-export-0.webp} (100%) rename static/pics/{geogebra-export (1).webp => geogebra-export-1.webp} (100%) rename static/pics/{geogebra-export (2).webp => geogebra-export-2.webp} (100%) rename static/pics/{geogebra-export (3).webp => geogebra-export-3.webp} (100%) rename static/pics/{geogebra-export (4).webp => geogebra-export-4.webp} (100%) rename static/pics/{geogebra-export (5).webp => geogebra-export-5.webp} (100%) rename static/pics/{geogebra-export (6).webp => geogebra-export-6.webp} (100%) rename static/pics/{geogebra-export (7).webp => geogebra-export-7.webp} (100%) rename static/pics/{geogebra-export (8).webp => geogebra-export-8.webp} (100%) diff --git a/docs/12-autodiff.md b/docs/12-autodiff.md index 5a86d84..b8b6418 100644 --- a/docs/12-autodiff.md +++ b/docs/12-autodiff.md @@ -1,32 +1,32 @@ -# Case Study: Automatic Differentiation +# 12. Case Study: Autodiff -Today, we will talk about another case study on automatic differentiation, while avoiding some of the complex mathematical concepts. +Today, we will talk about another case study on automatic differentiation (autodiff), while avoiding some of the complex mathematical concepts. Differentiation is an important operation in computer science. In machine learning, neural networks based on gradient descent apply differentiation to find local minima for training. You might be more familiar with solving functions and approximating zeros using Newton's method. Let's briefly review it. Here, we have plotted a function and set the initial value to 1, which is point A on the number axis. -![height:600px](../pics/geogebra-export.png) +![](/pics/geogebra-export-0.webp) -![height:600px](../pics/geogebra-export%20(1).png) +![](/pics/geogebra-export-1.webp) We want to approximate the zeros near it. We calculate point B on the function corresponding to the x-coordinate of this point and find the derivative at the point, which is the slope of the tangent line at that point. -![height:600px](../pics/geogebra-export%20(2).png) +![](/pics/geogebra-export-2.webp) -![height:600px](../pics/geogebra-export%20(3).png) +![](/pics/geogebra-export-3.webp) By finding the intersection of the tangent line and the x-axis, we get a value that approximates zero. -![height:600px](../pics/geogebra-export%20(4).png) +![](/pics/geogebra-export-4.webp) We then repeat the process to find the point corresponding to the function, calculate the derivative, and find the intersection of the tangent line and the x-axis. -![height:600px](../pics/geogebra-export%20(6).png) +![](/pics/geogebra-export-5.webp) -![height:600px](../pics/geogebra-export%20(7).png) +![](/pics/geogebra-export-6.webp) This way, we can gradually approach zero and get an approximate solution. We will provide the code implementation at the end. -![height:600px](../pics/geogebra-export%20(8).png) +![](/pics/geogebra-export-7.webp) Today, we will look at the following simple combination of functions, involving only addition and multiplication. For example, when calculating 5 times $x_0$ squared plus $x_1$, if $x_0$ is 10 and $x_1$ is 100, we need to calculate the value of the function, 600, the partial derivative with respect to $x_0$, 100, and the partial derivative with respect to $x_1$, 1. diff --git a/static/pics/geogebra-export.webp b/static/pics/geogebra-export-0.webp similarity index 100% rename from static/pics/geogebra-export.webp rename to static/pics/geogebra-export-0.webp diff --git a/static/pics/geogebra-export (1).webp b/static/pics/geogebra-export-1.webp similarity index 100% rename from static/pics/geogebra-export (1).webp rename to static/pics/geogebra-export-1.webp diff --git a/static/pics/geogebra-export (2).webp b/static/pics/geogebra-export-2.webp similarity index 100% rename from static/pics/geogebra-export (2).webp rename to static/pics/geogebra-export-2.webp diff --git a/static/pics/geogebra-export (3).webp b/static/pics/geogebra-export-3.webp similarity index 100% rename from static/pics/geogebra-export (3).webp rename to static/pics/geogebra-export-3.webp diff --git a/static/pics/geogebra-export (4).webp b/static/pics/geogebra-export-4.webp similarity index 100% rename from static/pics/geogebra-export (4).webp rename to static/pics/geogebra-export-4.webp diff --git a/static/pics/geogebra-export (5).webp b/static/pics/geogebra-export-5.webp similarity index 100% rename from static/pics/geogebra-export (5).webp rename to static/pics/geogebra-export-5.webp diff --git a/static/pics/geogebra-export (6).webp b/static/pics/geogebra-export-6.webp similarity index 100% rename from static/pics/geogebra-export (6).webp rename to static/pics/geogebra-export-6.webp diff --git a/static/pics/geogebra-export (7).webp b/static/pics/geogebra-export-7.webp similarity index 100% rename from static/pics/geogebra-export (7).webp rename to static/pics/geogebra-export-7.webp diff --git a/static/pics/geogebra-export (8).webp b/static/pics/geogebra-export-8.webp similarity index 100% rename from static/pics/geogebra-export (8).webp rename to static/pics/geogebra-export-8.webp