MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / __iter__

Method __iter__

examples/DeepQNetwork/expreplay.py:364–378  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

362
363 # DataFlow method:
364 def __iter__(self):
365 # wait for memory to be initialized
366 self._init_memory_flag.wait()
367
368 while True:
369 idx = self.rng.randint(
370 0, len(self.mem) - self.history_len - 1,
371 size=self.batch_size)
372 batch_exp = [self.mem.sample(i) for i in idx]
373
374 yield self._process_batch(batch_exp)
375
376 # execute update_freq=4 new actions into memory, after each batch update
377 for _ in range(self.update_frequency):
378 self.runner.step(self.exploration)
379
380 # Callback methods:
381 def _setup_graph(self):

Callers

nothing calls this directly

Calls 3

_process_batchMethod · 0.95
sampleMethod · 0.80
stepMethod · 0.45

Tested by

no test coverage detected