MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / classify_step

Function classify_step

functions.py:156–161  ·  view source on GitHub ↗
(logit, classes)

Source from the content-addressed store, hash-verified

154
155
156def classify_step(logit, classes):
157 class_vector = F.softmax(logit, 1).data.squeeze()
158 assert len(class_vector) == len(classes), "class number must match"
159 probs, idx = class_vector.sort(0, True)
160 result = classes[idx[0]]
161 return result

Callers 1

testMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected