Skip to content

Commit 650e540

Browse files
authored
Merge pull request #11 from QuantEcon/code_fix
Update newton and opt_transport
2 parents 5e76cef + 7cfb743 commit 650e540

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lectures/newton_method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ k_star_approx_newton = newton(f=lambda x: g(x, params) - x,
426426
```
427427

428428
```{code-cell} ipython3
429-
k_star_近似牛顿法
429+
k_star_approx_newton
430430
```
431431

432432
结果证实了我们在上面图表中看到的收敛情况:仅需5次迭代就达到了非常精确的结果。

lectures/opt_transport.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ arr = np.arange(m+n)
403403
```
404404
405405
```{code-cell} ipython3
406-
已找到解 = []
407-
成本 = []
406+
sol_found = []
407+
cost = []
408408
409409
# 模拟1000次
410410
for i in range(1000):
@@ -414,9 +414,9 @@ for i in range(1000):
414414
415415
# 如果找到新解
416416
sol = tuple(res_shuffle.x)
417-
if sol not in 已找到解:
418-
已找到解.append(sol)
419-
成本.append(res_shuffle.fun)
417+
if sol not in sol_found:
418+
sol_found.append(sol)
419+
cost.append(res_shuffle.fun)
420420
```
421421
422422
```{code-cell} ipython3

0 commit comments

Comments
 (0)