Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TorchSSL/TorchSSL
/ entropy_loss
Function
entropy_loss
models/vat/vat_utils.py:17–19 ·
view source on GitHub ↗
(ul_y)
Source
from the content-addressed store, hash-verified
15
return
self.value
16
17
def
entropy_loss(ul_y):
18
p = F.softmax(ul_y, dim=1)
19
return
-(p*F.log_softmax(ul_y, dim=1)).sum(dim=1).mean(dim=0)
20
21
def
_l2_normalize(d):
22
Callers
1
train
Method · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected