Skip to content

Commit 088f91f

Browse files
committed
shorten code length to have each line under 80 characters
1 parent 89d1b09 commit 088f91f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lectures/mccall_q.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,13 @@ def temp_diff(model, qtable, state, accept, key):
530530
531531
def accept_case():
532532
state_next = state
533+
value_if_no_quit = (w[state_next] + β * jnp.max(qtable[state_next, :])
534+
- qtable[state, accept])
535+
value_if_quit = (w[state_next] + β * qtable[state_next, 1]
536+
- qtable[state, accept])
533537
td = jnp.where(model.quit_allowed == 0,
534-
w[state_next] + β * jnp.max(qtable[state_next, :]) - qtable[state, accept],
535-
w[state_next] + β * qtable[state_next, 1] - qtable[state, accept])
538+
value_if_no_quit,
539+
value_if_quit)
536540
return td, state_next
537541
538542
return jax.lax.cond(accept == 0, reject_case, accept_case)

0 commit comments

Comments
 (0)