Reinforcement Learning Q Network DQN-Cart pole game code tutorial

Reinforcement learning (RL) is a field in machine learning. It is distinguished from supervised learning and unsupervised learning. It emphasizes how to act based on the environment to maximize expected benefits. Basic operating steps: The agent learns agentin the environment , performs actions based on the state of the environment (or observed ) , and guides better actions based on feedback (rewards) from the environment. For example, in the Cart pole game of this project, it is the pole in the animation, and the pole can be moved to the left or right .environmentstateobservationactionrewardagentaction

In [ ]:

## Install dependencies
!pip install pygame
!pip install gym
!pip install atari_py
!pip install parl

In [12]:

import gym
import us
import random
import collections

import paddle
import paddle.nn as nn
import numpy as np
import paddle.nn.functional as F

1. Experience playback part

The main things that experience playback does

おすすめ

転載: blog.csdn.net/pythonyanyan/article/details/131747432