diff --git a/k-bandits.py b/k-bandits.py index 84c6bb5..dfed985 100644 --- a/k-bandits.py +++ b/k-bandits.py @@ -50,7 +50,7 @@ if __name__ == '__main__': # init bandits with different biases for shifting reward probability # -> expected reward q*(a) - ql_star = np.array([-0.4, -0.3, -0.2, -0.1, 0.0, +0.1, +0.2, +0.3, +0.4, +0.5]) + ql_star = np.array(np.linspace(-0.5, +0.5, K)) num_realisations = 10 episode_len = 10000 @@ -68,6 +68,9 @@ if __name__ == '__main__': pl.plot(r_mean/num_realisations) pl.grid() + pl.title(f"Norm. E(R), num. realizations: Z={num_realisations}, num. bandits: K={K}") + pl.xlabel("Episode") + pl.ylabel("E(R)/Z") ax = pl.gca() ax.set_xlim([-episode_len/10, episode_len]) ax.set_ylim([0, 1])