back_prop, stats_examples, endogenous_lake, multi_hyper: four small fixes

Aperta
#1,111 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TeX
Stelle
129
Fork
59
Merge medio
2g 10h
PR unite (30g)
11

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di QuantEcon/lecture-python.myst

Tutte le issue di QuantEcon/lecture-python.myst

Issue simili

Altre issue su Data Engineering

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.