def rargmax(vector):
# random argmax
m = np.max(vector)
indices = np.nonzero(vector == m)[0]
return pr.choice(indices)
# Reward Update Q
# Algorithm
# For each s,a initialize table entry Q(s,a)<-0
# Observe current stat s
# Do foever:
# select an action a and execute it
# receive immediate reward
# observe the new state
# update the table entry for Q(s,a)
# update the state
评论列表
文章目录