black formatted files before changes
This commit is contained in:
@@ -38,7 +38,9 @@ def log_sum_exp(tensor, dim=-1, sum_op=torch.sum):
|
||||
:return: LSE
|
||||
"""
|
||||
max, _ = torch.max(tensor, dim=dim, keepdim=True)
|
||||
return torch.log(sum_op(torch.exp(tensor - max), dim=dim, keepdim=True) + 1e-8) + max
|
||||
return (
|
||||
torch.log(sum_op(torch.exp(tensor - max), dim=dim, keepdim=True) + 1e-8) + max
|
||||
)
|
||||
|
||||
|
||||
def binary_cross_entropy(x, y):
|
||||
|
||||
Reference in New Issue
Block a user