Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lectures/newton_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ k_star_approx_newton = newton(f=lambda x: g(x, params) - x,
```

```{code-cell} ipython3
k_star_近似牛顿法
k_star_approx_newton
```

结果证实了我们在上面图表中看到的收敛情况:仅需5次迭代就达到了非常精确的结果。
Expand Down
10 changes: 5 additions & 5 deletions lectures/opt_transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ arr = np.arange(m+n)
```

```{code-cell} ipython3
已找到解 = []
成本 = []
sol_found = []
cost = []

# 模拟1000次
for i in range(1000):
Expand All @@ -414,9 +414,9 @@ for i in range(1000):

# 如果找到新解
sol = tuple(res_shuffle.x)
if sol not in 已找到解:
已找到解.append(sol)
成本.append(res_shuffle.fun)
if sol not in sol_found:
sol_found.append(sol)
cost.append(res_shuffle.fun)
```

```{code-cell} ipython3
Expand Down
Loading