def __init__(self,
action_space,
observation_space,
q_init=0.0,
learning_rate=0.1,
discount=1.0,
epsilon=0.05):
if not isinstance(action_space, spaces.Discrete):
raise TypeError("Action space type should be Discrete.")
if not isinstance(observation_space, spaces.Discrete):
raise TypeError("Observation space type should be Discrete.")
self._action_space = action_space
self._learning_rate = learning_rate
self._discount = discount
self._epsilon = epsilon
self._q = defaultdict(lambda: q_init * np.ones(action_space.n))
评论列表
文章目录