我正在尝试将强化学习应用于代理使用循环网络与连续数值输出交互的问题。基本上,这是一个控制问题,其中两个输出控制代理的行为方式。
我将策略定义为 epsilon 贪婪,其中使用输出控制值的时间为 (1-eps),使用输出值+/-小高斯扰动的时间为 eps。 从这个意义上说,代理可以探索。 在大多数强化文献中,我看到策略学习需要离散的 Action ,可以使用 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
,其中包含将使用标准反向传播学习的操作。
有人可以告诉我正确或更好的方法吗?
最佳答案
策略梯度方法有利于学习连续控制输出。如果你看http://rll.berkeley.edu/deeprlcourse/#lectures ,2月13日的讲座以及3月8日至3月15日的讲座可能对您有用。那里也介绍了 Actor Critic 方法。
关于reinforcement-learning - 如何用回归而不是分类来进行强化学习,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44846312/