back_prop, stats_examples, endogenous_lake, multi_hyper: four small fixes

未关闭
#1,111 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

Read the four named lecture files at the cited sections: lectures/back_prop.md, lectures/stats_examples.md, lectures/endogenous_lake.md, and lectures/multi_hyper.md. Check the described training shuffle, Pascal formulas, job-finding comparison and message, and count loop length against the issue. Done when each listed correction is reflected and the install cell remains runnable.

由索引模型根据 Issue 内容生成。

描述

Four small things found while these lectures were reviewed on their way into the shared lecture pool (QuantEcon/lectures#44). None is urgent. Line numbers are at 4d82fff.

  • lectures/back_prop.md, train (line 501): each epoch splits key, but line 504 draws the permutation from a fixed random.key(1), so the data come in the same order every epoch and the key argument has no effect. key, subkey = random.split(key) followed by random.permutation(subkey, indices) shuffles as intended.
  • lectures/stats_examples.md, the Pascal (negative binomial) section (lines 121–122): the mean and variance are written with $k$, the value of $X$, where the parameter $r$ belongs: they should read $\mathbb{E}(X) = r(1-p)/p$ and $\mathbb{V}(X) = r(1-p)/p^2$.
  • lectures/endogenous_lake.md, the job-finding rate (lines 338, 464 and 496): the text accepts an offer when $w \geq \bar w$ (lines 84 and 319), but the code counts w_vec > w_bar. Since w_bar is the first grid wage at which accepting is optimal (jnp.searchsorted(V - U, 0)), the strict inequality treats the reservation wage itself as rejected and understates $\lambda$ by $\gamma , p(\bar w)$; >= matches the text. The message printed at line 339 also reads "paramters".
  • lectures/multi_hyper.md, count (line 391): it takes its loop length from the global sample (size = sample.shape[0], line 392) rather than from its own arguments. It gives the right answer here, since it is only called with columns of sample, but Numba freezes global arrays when it compiles, so size = vec1.shape[0] is the safer form.

The same review asked for skip-execution on back_prop's install cell, but that cell is meant to run: the lecture uses kaleido and plotly afterwards.

When these land here, the pool picks them up through its nightly refresh.

主要语言
TeX
星标
129
派生
59
平均合并
2 天 10 小时
30 天内合并 PR
11

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

QuantEcon/lecture-python.myst 的其他 Issue

查看 QuantEcon/lecture-python.myst 的全部 Issue

相似的 Issue

更多 Data Engineering Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。