forked from chenzomi12/AISystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chenzomi
committed
Oct 2, 2022
1 parent
b209173
commit 7c221b3
Showing
25 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,11 @@ | |
"\n", | ||
"> 前向模式(Forward Automatic Differentiation,也叫做 tangent mode AD)或者前向累积梯度(前向模式)\n", | ||
"\n", | ||
"\n", | ||
"\n", | ||
"前向自动微分中,从计算图的起点开始,沿着计算图边的方向依次向前计算,最终到达计算图的终点。它根据自变量的值计算出计算图中每个节点的值 以及其导数值,并保留中间结果。一直得到整个函数的值和其导数值。整个过程对应于一元复合函数求导时从最内层逐步向外层求导。\n", | ||
"\n", | ||
"\n", | ||
"\n", | ||
"\n", | ||
"简单确实简单,可以总结前向自动微分关键步骤为:\n", | ||
"\n", | ||
|
@@ -123,7 +125,7 @@ | |
" dx = self.dx - other.dx\n", | ||
" elif isinstance(other, float):\n", | ||
" x = self.x - other\n", | ||
" ex = self.dx\n", | ||
" dx = self.dx\n", | ||
" else:\n", | ||
" return NotImplementedError\n", | ||
" return ADTangent(x, dx)\n", | ||
|
@@ -154,7 +156,7 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"以公式5为例:\n", | ||
"以下面为例:\n", | ||
"\n", | ||
"$$\n", | ||
"f(x1,x2)=ln(x1)+x1x2−sin(x2) \\tag{1}\n", | ||
|
@@ -179,9 +181,9 @@ | |
} | ||
], | ||
"source": [ | ||
"x = ADTangent(x=2., dx=1)\n", | ||
"y = ADTangent(x=5., dx=0)\n", | ||
"f = ADTangent.log(x) + x * y - ADTangent.sin(y)\n", | ||
"x1 = ADTangent(x=2., dx=1)\n", | ||
"x2 = ADTangent(x=5., dx=0)\n", | ||
"f = ADTangent.log(x) + x * x2 - ADTangent.sin(x2)\n", | ||
"print(f)" | ||
] | ||
}, | ||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters