Skip to content

Commit

Permalink
Use alwaysComputeGreedyQ for recurrent
Browse files Browse the repository at this point in the history
  • Loading branch information
lake4790k committed Jun 27, 2016
1 parent 626712b commit 2224b8a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions async/QAgent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ function QAgent:_init(opt, policyNet, targetNet, theta, targetTheta, atomic, sha
self.dTheta:zero()

self.doubleQ = opt.doubleQ
self.recurrent = opt.recurrent

self.epsilonStart = opt.epsilonStart
self.epsilon = self.epsilonStart
Expand All @@ -34,7 +33,8 @@ function QAgent:_init(opt, policyNet, targetNet, theta, targetTheta, atomic, sha
self.tic = 0
self.step = 0

self.alwaysComputeGreedyQ = not self.doubleQ
-- Forward state anyway if recurrent
self.alwaysComputeGreedyQ = opt.recurrent or not self.doubleQ

self.QCurr = torch.Tensor(0)
end
Expand All @@ -61,10 +61,6 @@ function QAgent:eGreedy(state, net)
end

if torch.uniform() < self.epsilon then
-- Forward state anyway if recurrent
if self.recurrent then
net:forward(state)
end
return torch.random(1,self.m)
end

Expand Down

0 comments on commit 2224b8a

Please sign in to comment.