Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-leonard committed Apr 20, 2016
1 parent 6857c44 commit 9751588
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ReinforceGamma.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
local ReinforceGamma, parent = torch.class("nn.ReinforceGamma", "nn.Reinforce")

function ReinforceGamma:__init(scale, stochastic)
require('randomkit') -- needed to sample gamma dist
require('cephes') -- needed to compute digamma for gradient
require('randomkit') -- needed to sample gamma dist : luarocks install randomkit
require('cephes') -- needed to compute digamma for gradient :
parent.__init(self, stochastic)
self.scale = scale
if not scale then
Expand Down
6 changes: 4 additions & 2 deletions test/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1669,13 +1669,15 @@ function dpnnbigtest.Reinforce()
end
reward = reward/inputs:size(1)

if reward*0.7 >= baseReward then
-- is the baseReward lesser than 70% of reward after training?
-- i.e. did the reward increase sufficiently?
if reward*0.7 > baseReward then
converged = true
break
end
end

if reward*0.7 >= baseReward then
if reward*0.7 > baseReward then
converged = true
break
end
Expand Down

0 comments on commit 9751588

Please sign in to comment.