MCPcopy Create free account
hub / github.com/ckd0817/LLM-Interview-Code / softmax

Function softmax

loss/EntropyLoss.py:15–41  ·  view source on GitHub ↗

数值稳定的 Softmax 函数 通过减去最大值来避免数值溢出问题。 Args: logits: 未归一化的对数概率 [batch_size, num_classes] Returns: softmax: 归一化的概率分布 [batch_size, num_classes]

(logits)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

KL_divergenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected