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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
[code=python]
def initialize_centroid(self, data_loader: DataLoader) -> None:
if self.gamma_c > 1:
# TODO: Create PyTorch KMeans class.
k_means = KMeans(n_clusters=(self.scale[0] * self.scale[1]) // self.gamma_c, max_iter=3000)
cluster_centers = k_means.fit(self.memory_bank.cpu()).cluster_centers_
self.memory_bank = torch.tensor(cluster_centers, requires_grad=False).to(device)
[/code]
请问怎么理解 源代码中 在初始化memorybank的时候 self.gamma_c的作用 以及k-means的作用吗?
Beta Was this translation helpful? Give feedback.
All reactions