PyTorch torch.expm1-Funktion
PyTorch torch Referenzhandbuch
torch.expm1Es ist eine Funktion in PyTorch, die verwendet wird, um exp(x) - 1 elementweise zu berechnen.
Funktionsdefinition
torch.expm1(input, *, out=None)
Anwendungsbeispiel
Beispiel
import torch
# Beispiel für exp(x) - 1
x = torch.tensor([0, 1, 2, 3], dtype=torch.float32)
result = torch.expm1(x)
print(result) # tensor([0.0000, 1.7183, 6.3891, 19.0855])
# Beispiel für exp(x) - 1
x = torch.tensor([0, 1, 2, 3], dtype=torch.float32)
result = torch.expm1(x)
print(result) # tensor([0.0000, 1.7183, 6.3891, 19.0855])
Andere Erweiterungen