MCPcopy Create free account
hub / github.com/microsoft/Cream / stack_random_cand

Method stack_random_cand

AutoFormer/evolution.py:120–128  ·  view source on GitHub ↗
(self, random_func, *, batchsize=10)

Source from the content-addressed store, hash-verified

118 self.keep_top_k[k] = t[:k]
119
120 def stack_random_cand(self, random_func, *, batchsize=10):
121 while True:
122 cands = [random_func() for _ in range(batchsize)]
123 for cand in cands:
124 if cand not in self.vis_dict:
125 self.vis_dict[cand] = {}
126 info = self.vis_dict[cand]
127 for cand in cands:
128 yield cand
129
130 def get_random_cand(self):
131

Callers 3

get_randomMethod · 0.95
get_mutationMethod · 0.95
get_crossoverMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected