INNER CODE UNIT · Python
episodes
rasbt/machine-learning-book · ch19/cartpole/main.py:115
episodes = np.arange(len(history)) + 1
plt.plot(episodes, history, lw=4,
marker='o', markersize=10)
ax.tick_params(axis='both', which='major', labelsize=15)
plt.xlabel('Episodes', size=20)
plt.ylabel('Total rewards', size=20)
plt.show()
# General settings
EPISODES = 200
batch_size = 32
init_replay_memory_size = 500
if __name__ == '__main__':
env = gym.make('CartPole-v1')
agent = DQNAgent(env)
state = env.reset()