MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / _parse

Method _parse

AutoML/darts-master/rnn/model_search.py:77–91  ·  view source on GitHub ↗
(probs)

Source from the content-addressed store, hash-verified

75 def genotype(self):
76
77 def _parse(probs):
78 gene = []
79 start = 0
80 for i in range(STEPS):
81 end = start + i + 1
82 W = probs[start:end].copy()
83 j = sorted(range(i + 1), key=lambda x: -max(W[x][k] for k in range(len(W[x])) if k != PRIMITIVES.index('none')))[0]
84 k_best = None
85 for k in range(len(W[j])):
86 if k != PRIMITIVES.index('none'):
87 if k_best is None or W[j][k] > W[j][k_best]:
88 k_best = k
89 gene.append((PRIMITIVES[k_best], j))
90 start = end
91 return gene
92
93 gene = _parse(F.softmax(self.weights, dim=-1).data.cpu().numpy())
94 genotype = Genotype(recurrent=gene, concat=range(STEPS+1)[-CONCAT:])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected