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

Possible mistake in cluster probe loss function? #32

Open
PeaBrane opened this issue Jun 25, 2022 · 0 comments
Open

Possible mistake in cluster probe loss function? #32

PeaBrane opened this issue Jun 25, 2022 · 0 comments

Comments

@PeaBrane
Copy link

PeaBrane commented Jun 25, 2022

I'm under the impression that the loss function of the cluster probe is simply the entropy of the cluster probabilities.

However, in the ClusterLookup class in modules.py, the loss function is defined as

cluster_loss = -(cluster_probs * inner_products).sum(1).mean()

Shouldn't this instead be

cluster_loss = -(cluster_probs * cluster_probs.log()).sum(1).mean()

Or alternatively (assuming alpha = 1),

cluster_probs_log = inner_products - inner_products.exp().sum(1, keepdims=True).log()
cluster_loss = -(cluster_probs * cluster_probs_log).sum(1).mean()
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

1 participant