You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
indices = np.where(
(embeddings == local_cluster_embeddings_[:, None]).all(-1)
)[1]
are producing this error:
AttributeError: 'bool' object has no attribute 'all'
Background:
both embeddings and local_cluster_embeddings_ are of type numpy.ndarray
embeddings.shape: (507362, 768)
local_cluster_embeddings.shape: (749, 768)
local_cluster_embeddings[:, None].shape: (749, 1, 768)
If I knew what this was supposed to do (i.e., get the indices of the nodes in the local cluster maybe?) I could maybe work around this. But right now I'm flubbered as to what is going wrong and what it's supposed to do!
The text was updated successfully, but these errors were encountered:
I think this may have something to do with the size of the dataset. I ran through a subset of the data (50K vs 500K entries) and this incomprehensible (me me anyway!) line of code works as advertised. Apparently it is capturing the indices of the entries within embeddings that match the entries in local_cluster_embeddings_. I have NO idea WHY this works (the two arrays have a different shape!), but it seems to do so. Oh, and a comment would have been nice. :)
These lines:
are producing this error:
AttributeError: 'bool' object has no attribute 'all'
Background:
both embeddings and local_cluster_embeddings_ are of type numpy.ndarray
embeddings.shape: (507362, 768)
local_cluster_embeddings.shape: (749, 768)
local_cluster_embeddings[:, None].shape: (749, 1, 768)
so an apparent shape mis-match?
embeddings == local_cluster_embeddings_[:, None]: False
(embeddings == local_cluster_embeddings_[:, None]): False
so no all(), hence
(embeddings == local_cluster_embeddings_[:, None]).all(-1): ERROR!
If I knew what this was supposed to do (i.e., get the indices of the nodes in the local cluster maybe?) I could maybe work around this. But right now I'm flubbered as to what is going wrong and what it's supposed to do!
The text was updated successfully, but these errors were encountered: