In [3]:
require "dqn";
require 'cunn';
plot = require 'itorch.Plot'

In [11]:
if agent then
    agent = nil
end
collectgarbage()
collectgarbage()
agent = torch.load('Itorch_DQN3_0_1_pong_FULL_Y.t7')
--print(agent)

In [21]:
function plot_results(field)
    if not agent or not agent[field] then
        print('Agent or field not found ', field)
        print(agent)
        return
    end
    local x = agent[field]
    if #x == 1 then x[2] = x[1] end
    plot():line(torch.range(1,#x), torch.Tensor(x)):title(field):draw();
end
plot_results('reward_history')



In [16]:
agent['reward_history']


Out[16]:
{
  1 : -21
}

In [ ]: