Use eigh instead of eig
The mean of Hermitian matrices is also Hermitian
This commit is contained in:
parent
7ffad6ffac
commit
44080bf833
@ -113,11 +113,12 @@ class AoA:
|
||||
|
||||
def evaluate(self, theta: torch.Tensor, tof: torch.Tensor) -> torch.Tensor:
|
||||
R = torch.mean(self.historical_autocorr, dim=0)
|
||||
assert (R == torch.conj(R).T).all()
|
||||
|
||||
# The smallest eigenvectors span the noise subspace,
|
||||
# and the largest span the signal subspace.
|
||||
logger.debug(f"Calculating eigenvectors of R: {R.shape}")
|
||||
eigvals, eigvecs = torch.linalg.eig(R)
|
||||
eigvals, eigvecs = torch.linalg.eigh(R)
|
||||
assert isinstance(eigvals, torch.Tensor)
|
||||
assert isinstance(eigvecs, torch.Tensor)
|
||||
logger.info(f"Eigenvalues: {eigvals}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user