Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About icarl_construct_exemplar_set function #3

Open
superduduguan opened this issue Jun 23, 2021 · 1 comment
Open

About icarl_construct_exemplar_set function #3

superduduguan opened this issue Jun 23, 2021 · 1 comment

Comments

@superduduguan
Copy link

Hi, I think the following codes seem not proper:

exemplar_set = []
exemplar_features = [] # list of Variables of shape (feature_size,)
exemplar_dist = []
for k in range(int(m)):
S = np.sum(exemplar_features, axis=0)
phi = features
mu = class_mean
mu_p = 1.0/(k+1) * (phi + S)
mu_p = mu_p / np.linalg.norm(mu_p)
dist = np.sqrt(np.sum((mu - mu_p) ** 2, axis=1))
idx = np.random.randint(0, features.shape[0])
exemplar_dist.append(dist[idx])
exemplar_set.append(images[idx])
exemplar_features.append(features[idx])
features[idx, :] = 0.0

After debugging I find that when features[idx, :] = 0.0 implemented, exemplar_features is also set to 0, thus S is always full of 0 at any time, making it meaningless. I am not sure whether it is a common problem or it is triggered due to my incompatible version of packages.
Besides, what if the random saving strategy get the same index? Is it right the purpose of setting the corresponding feature to 0, so that in the next phase the repetitive sample has a large distance and will be deleted? But still, what if class_mean itself is close to 0?

@haoweiz23
Copy link

I am confused about the meaning of S and mu_p, why not compute the distance between features and mu directly? Does anyone have idea about that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants