Skip to content
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
16 changes: 0 additions & 16 deletions chainerrl/agents/dqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
from chainerrl.replay_buffer import ReplayUpdater


def _to_device(obj, gpu):
if isinstance(obj, tuple):
return tuple(_to_device(x, gpu) for x in obj)
else:
if gpu >= 0:
return cuda.to_gpu(obj, gpu)
else:
return cuda.to_cpu(obj)


def compute_value_loss(y, t, clip_delta=True, batch_accumulator='mean'):
"""Compute a loss for value prediction problem.

Expand Down Expand Up @@ -380,12 +370,6 @@ def compute_q_values(self, states):
self.model(batch_x).q_values))
return q_values

def _to_my_device(self, model):
if self.gpu >= 0:
model.to_gpu(self.gpu)
else:
model.to_cpu()

def act(self, state):
with chainer.using_config('train', False):
with chainer.no_backprop_mode():
Expand Down