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

Seems like a mismatch between implementation code & mathematical formulation in the paper #1

Closed
Buhua-Liu opened this issue Sep 14, 2021 · 1 comment

Comments

@Buhua-Liu
Copy link

Buhua-Liu commented Sep 14, 2021

My understanding:

  • RFF: random_fourier_features_gpu() adds a new dimension of size num_f rather than performs dimension transformation.
  • lossb_expect(cfeaturec, num_f) computes the square of the Frobenius norm of the original feature vector (of size batch_size * feature_dimemsion ) at each num_f dimension, then accumulating them minus the trace of covariance matrix gives the final loss.

Question:

  • Does cfeaturec refer to A_i and B_i, and n the batch size in Eq. (3)?
  • num_f refer to n_A and n_B in Eq. (4)?
    image
@xxgege
Copy link
Owner

xxgege commented Sep 22, 2021

  1. Actually, A and B refer to two variables and equation and equation refer to features of the representation, as described in Section 3.1 of the paper. Thus cfeaturec does not refer to A_i and B_i, but (A_1, ..., A_n) and (B_1, ... ,B_n) refer to two variables in cfeature. n refers to the batch size.
  2. Actually, n_A and n_B are twice of num_f, because when we randomly sample one set of w and b for RFF, both sine and cosine of the feature are calculated.

@xxgege xxgege closed this as completed Oct 21, 2021
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