【发布时间】:2017-12-04 09:43:19
【问题描述】:
我正在尝试将强化学习应用于代理使用循环网络与连续数值输出交互的问题。基本上,这是一个控制问题,其中两个输出控制代理的行为。
我将一个策略定义为 epsilon greedy,其中 (1-eps) 时间使用输出控制值,而 eps 时间使用输出值 +/- 小高斯扰动。 从这个意义上说,代理可以探索。 在大多数强化文献中,我看到策略学习需要离散动作,可以使用 REINFORCE (Williams 1992) 算法学习,但是我不确定在这里使用什么方法。
目前我所做的是使用掩码仅学习最佳选择,使用基于 Metropolis Hastings 的算法来确定过渡是否朝着最佳策略发展。伪代码:
input: rewards, timeIndices
// rewards in (0,1) and optimal is 1
// relate rewards to likelihood via L(r) = exp(-|r - 1|/std)
// r <= 1 => |r - 1| = 1 - r
timeMask = zeros(timeIndices.length)
neglogLi = (1 - mean(rewards)) / std
// Go through random order of reward to approximate Markov process
for r,idx in shuffle(rewards, timeIndices):
neglogLj = (1 - r)/std
if neglogLj < neglogLi || log(random.uniform()) < neglogLi - neglogLj:
// Accept transition, i.e. learn this action
targetMask[idx] = 1
neglogLi = neglogLj
这提供了一个targetMask,其中包含将使用标准反向传播学习的操作。
谁能告诉我正确或更好的方法?
【问题讨论】: