@@ -680,10 +680,8 @@ valfunc_VFI
680680```
681681
682682```{code-cell} ipython3
683- def plot_epochs(epochs_to_plot, quit_allowed=1, key=None ):
683+ def plot_epochs(epochs_to_plot, quit_allowed=1, key=key ):
684684 "Plot value function implied by outcomes of an increasing number of epochs."
685- if key is None:
686- key = jax.random.PRNGKey(42) # Default key if none provided
687685
688686 qlmc_new = create_qlearning_mccall(w=w_new, q=q_new, quit_allowed=quit_allowed)
689687 qtable = jnp.zeros((len(w_new),2))
@@ -715,7 +713,7 @@ def plot_epochs(epochs_to_plot, quit_allowed=1, key=None):
715713```
716714
717715```{code-cell} ipython3
718- plot_epochs(epochs_to_plot=[100, 1000, 10000, 100000, 200000])
716+ plot_epochs(epochs_to_plot=[100, 1000, 10000, 100000, 200000], key=key )
719717```
720718
721719The above graphs indicates that
@@ -761,7 +759,7 @@ But if we increase the number of epochs/episodes, we can observe that the error
761759We illustrate these possibilities with the following code and graph.
762760
763761```{code-cell} ipython3
764- plot_epochs(epochs_to_plot=[100, 1000, 10000, 100000, 200000], quit_allowed=0)
762+ plot_epochs(epochs_to_plot=[100, 1000, 10000, 100000, 200000], quit_allowed=0, key=key )
765763```
766764
767765## Possible extensions
0 commit comments