MCPcopy Create free account
hub / github.com/TL-UESTC/UniMoS / gentropy

Function gentropy

model.py:478–482  ·  view source on GitHub ↗
(softmax_out)

Source from the content-addressed store, hash-verified

476
477
478def gentropy(softmax_out):
479 epsilon = 1e-5
480 msoftmax = softmax_out.mean(dim=0)
481 gentropy = -msoftmax * torch.log(msoftmax + epsilon)
482 return torch.sum(gentropy)
483
484
485def ent_loss(out):

Callers 1

ent_lossFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected