Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use alwaysComputeGreedyQ for recurrent #47

Merged
merged 1 commit into from
Jun 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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