MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / _flatten_binary_scores

Function _flatten_binary_scores

utils/common.py:560–571  ·  view source on GitHub ↗

Flattens predictions in the batch (binary case) Remove labels equal to 'ignore'

(scores, labels, ignore=None)

Source from the content-addressed store, hash-verified

558
559
560def _flatten_binary_scores(scores, labels, ignore=None):
561 """Flattens predictions in the batch (binary case)
562 Remove labels equal to 'ignore'
563 """
564 scores = scores.view(-1)
565 labels = labels.view(-1)
566 if ignore is None:
567 return scores, labels
568 valid = labels != ignore
569 vscores = scores[valid]
570 vlabels = labels[valid]
571 return vscores, vlabels
572
573
574def _lovasz_softmax(

Callers 1

_lovasz_hingeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected