MCPcopy Create free account
hub / github.com/clab/dynet / __init__

Method __init__

examples/reinforcement-learning/memory.py:25–33  ·  view source on GitHub ↗
(self, size, alpha=0.6)

Source from the content-addressed store, hash-verified

23# Prioritized Replay: https://arxiv.org/abs/1511.05952
24class PrioritizedMemory(object):
25 def __init__(self, size, alpha=0.6):
26 self.size = int(2 ** ceil(log(size, 2)))
27 self.memory = np.zeros(self.size, dtype=object)
28 self.sum_tree = SumTree(self.size)
29 self.min_tree = ReduceTree(self.size, min)
30 self.idx = 0
31 self.max_value = 1.
32 self.max_value_upper = 1000.
33 self.alpha = alpha
34
35 def store(self, exp):
36 idx = self.idx % self.size

Callers

nothing calls this directly

Calls 4

SumTreeClass · 0.90
ReduceTreeClass · 0.90
ceilFunction · 0.50
logFunction · 0.50

Tested by

no test coverage detected