<jupyter_start><jupyter_text>**Results**  Here is a graph of the results. If everything was done correctly you should see the rewards over the red line.  Black: This is the 100 episode rolling average  Red: This is the "solved" line at 195  Blue: This is the reward for each episode  Green: This is the value of epsilon scaled by 200  Yellow: This is where the tests started.<jupyter_code>from google.colab import drive
drive.mount('/content/drive')

np.save('/content/drive/My Drive/db/dqn/ddqn/rewards_cs',rewards)
np.save('/content/drive/My Drive/db/dqn/ddqn/TRAIN_END_cs',TRAIN_END)
#Plotting
rolling_average = np.convolve(rewards, np.ones(100)/100)

plt.plot(rewards)
plt.plot(rolling_average, color='black')
plt.axhline(y=195, color='r', linestyle='-') #Solved Line
#Scale Epsilon (0.001 - 1.0) to match reward (0 - 200) range
eps_graph = [200*x for x in epsilons]
plt.plot(eps_graph, color='g', linestyle='-')
#Plot the line where TESTING begins
plt.axvline(x=TRAIN_END, color='y', linestyle='-')
plt.xlim( (0,EPISODES) )
plt.ylim( (0,220) )
plt.show()
import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(10,5),dpi=500)

r_old=np.load('/content/drive/My Drive/db/dqn/ddqn/rewards.npy')
r_new=np.load('/content/drive/My Drive/db/dqn/ddqn/rewards_cs.npy')
TE_old=np.load('/content/drive/My Drive/db/dqn/ddqn/TRAIN_END.npy')
TE_new=np.load('/content/drive/My Drive/db/dqn/ddqn/TRAIN_END_cs.npy')

#rolling_average1 = np.convolve(r_old, np.ones(100)/100)
#rolling_average2 = np.convolve(r_new, np.ones(100)/100)

plt.plot(r_old, color= 'lightblue',label='DDQN')
plt.plot(r_new, color='steelblue',label='CS-DDQN')
#plt.plot(rolling_average1, color='grey')
#plt.plot(rolling_average1, color='black')
plt.axhline(y=195, color='r', linestyle='-') #Solved Line
#Scale Epsilon (0.001 - 1.0) to match reward (0 - 200) range
#eps_graph = [200*x for x in epsilons]
#plt.plot(eps_graph, color='g', linestyle='-')
#Plot the line where TESTING begins
plt.axvline(x=TE_old, color='sandybrown', linestyle='-')
plt.axvline(x=TE_new, color='saddlebrown', linestyle='-')
plt.xlim( (0,200) )
plt.ylim( (0,220) )
plt.ylabel('Rewards')
plt.title('Episodes')
plt.legend()

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16569113012156686, 'fraction_numerical': 0.03692030616839262, 'mean_word_length': 5.774390243902439, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '276916', 'license': 'Apache-2.0', 'n_tokens_mistral': 970, 'n_tokens_neox': 870, 'n_words': 193, 'path': 'Code/cartpole-v1/ddqn/CS_DDQN.ipynb', 'repo_name': 'mueedhafiz1982/DQN-ensemble-for-RL', 'size': '2221'}