MCPcopy Create free account
hub / github.com/OpenPPL/ppq / roll

Method roll

ppq/quantization/algorithm/exprimental.py:37–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 self.decay = 0.99
36
37 def roll(self) -> int:
38 if random.random() > self.e: selected = random.randint(0, len(self.arms) - 1)
39 else: selected = np.argmax([ema.pop() for ema in self.rewards])
40 self.last_selected = selected
41 return selected
42
43 def mark(self, rewards: float):
44 self.rewards[self.last_selected].push(rewards)

Callers 1

__call__Method · 0.95

Calls 1

popMethod · 0.45

Tested by

no test coverage detected