Closed rajasbansal closed 2 years ago
Hi, this is the pseudocode for herding algorithm. You need to run it class by class.
mean = torch.mean(features, dim=0, keepdim=True)
idx_selected = []
idx_left = np.arange(features.shape[0]).tolist()
for i in range(num):
det = mean*(i+1) - torch.sum(features[idx_selected], dim=0)
dis = distance(det, features[idx_left])
idx = torch.argmin(dis)
idx_selected.append(idx_left[idx])
del idx_left[idx]
I am trying to run the baseline for herding, but I see that the codebase pulls preprocessed versions of the dataset from google drive. Could you share the scripts used to run the herding algorithm?