b5e848af46b4a6fc21e718803dbf3d7c72afd72a,ch08/run_model.py,,,#,11

Before Change



    while True:
        step_idx += 1
        obs_v = Variable(torch.from_numpy(np.expand_dims(obs, 0)))
        out_v = net(obs_v)
        action_idx = out_v.max(dim=1)[1].data.cpu().numpy()[0]
        if np.random.random() < EPSILON:
            action_idx = env.action_space.sample()

After Change



    while True:
        step_idx += 1
        obs_v = torch.tensor([obs])
        out_v = net(obs_v)
        action_idx = out_v.max(dim=1)[1].item()
        if np.random.random() < EPSILON:
            action_idx = env.action_space.sample()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: b5e848af46b4a6fc21e718803dbf3d7c72afd72a
Time: 2018-04-27
Author: max.lapan@gmail.com
File Name: ch08/run_model.py
Class Name:
Method Name:


Project Name: ncullen93/torchsample
Commit Name: f4ca9b361adb382423c753f7f864a5dd0e454964
Time: 2017-05-12
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/tensor_transforms.py
Class Name: ToTensor
Method Name: __call__


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: b5e848af46b4a6fc21e718803dbf3d7c72afd72a
Time: 2018-04-27
Author: max.lapan@gmail.com
File Name: ch08/lib/validation.py
Class Name:
Method Name: validation_run