PyTorch torch.svd Funktion
PyTorch torch-Referenzhandbuch
torch.svdEs ist eine Funktion in PyTorch, die verwendet wird, um die Singulärwertzerlegung einer Matrix zu berechnen.
Funktionsdefinition
torch.svd(input, some, compute_uv, out)
Anwendungsbeispiel
Beispiel
import torch
A = torch.randn(3, 4)
# SVD-Zerlegung
U, S, V = torch.svd(A)
print("U-Form:", U.shape)
print("S-Form:", S.shape)
print("V-Form:", V.shape)
A = torch.randn(3, 4)
# SVD-Zerlegung
U, S, V = torch.svd(A)
print("U-Form:", U.shape)
print("S-Form:", S.shape)
print("V-Form:", V.shape)
Die Ausgabe ist:
U 形状: torch.Size([3, 3]) S 形状: torch.Size([3]) V 形状: torch.Size([4, 4])
Andere Erweiterungen