<jupyter_start><jupyter_text>We report moving avearage of rewards, since it's common in RL taks<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt

# We set a fancy theme
plt.style.use('ggplot')

colors = 'cbm'
plt.axis([0, max_steps*n_iter - smooth, -50.5, 50.5])
for j,a in enumerate(agents):
    r0ss = rw_agents[j]
    for i in range(N_EXP):
        plt.plot(moving_average(r0ss[i], 100), colors[j], alpha=0.05)

    plt.plot(moving_average(np.asarray(r0ss).mean(axis=0), 100), colors[j], alpha=1)

plt.xlabel('t');
plt.ylabel('R');

from matplotlib.lines import Line2D
cmap = plt.cm.coolwarm
custom_lines = [Line2D([0], [0], color=colors[::-1][i]) for i,_ in enumerate(agents)]

plt.legend(custom_lines,[a.__name__ for a in reversed(agents)], loc=4);

plt.savefig('img/4C_08_binary' + mode + '.png')<jupyter_output><empty_output><jupyter_text>For the adversary case (no forget):<jupyter_code>moving_average(np.asarray(rw_agents[-1]).mean(axis=0), 100).mean()
moving_average(np.asarray(rw_agents[-2]).mean(axis=0), 100).mean()
moving_average(np.asarray(rw_agents[-3]).mean(axis=0), 100).mean()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17456140350877192, 'fraction_numerical': 0.039473684210526314, 'mean_word_length': 6.409090909090909, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '663688', 'license': 'MIT', 'n_tokens_mistral': 502, 'n_tokens_neox': 449, 'n_words': 83, 'path': 'Experiment4C.ipynb', 'repo_name': 'vicgalle/ARAMARL', 'size': '1140'}