From a5b877b6a304a7430630c8440584d78b5d5c2ac5 Mon Sep 17 00:00:00 2001 From: pranavbrkr Date: Fri, 13 Oct 2023 16:29:22 -0700 Subject: [PATCH] utils --- Phase 2/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Phase 2/utils.py b/Phase 2/utils.py index 8353072..a3a892f 100644 --- a/Phase 2/utils.py +++ b/Phase 2/utils.py @@ -878,7 +878,7 @@ def extract_latent_semantics_from_feature_model( # singular value decomposition # sparse version of SVD to get only k singular values case 1: - U, S, V_T = svd(feature_vectors, k=k) + U, S, V_T = svds(feature_vectors, k=k) all_latent_semantics = { "image-semantic": U.tolist(), @@ -1246,4 +1246,4 @@ def compute_cp_decomposition(fd_collection, feature_model, rank): data_tensor[id, :, label] = all_images[id][feature_model] weights_tensor, factor_matrices = tl.decomposition.parafac(data_tensor, rank=rank, normalize_factors=True) - return weights_tensor, factor_matrices + return weights_tensor, factor_matrices \ No newline at end of file