universome / stylegan-v

[CVPR 2022] StyleGAN-V: A Continuous Video Generator with the Price, Image Quality and Perks of StyleGAN2
https://universome.github.io/stylegan-v
348 stars 35 forks source link

Linearly spaced periods stated in Appendix B.3 is not correct #25

Open johannwyh opened 2 years ago

johannwyh commented 2 years ago

Your equation in Appendix B.3 states that the sigma vector is linearly spaced between omega_min and omega_max.

However, your code in src/training/motion.py here implements frequencies as log-linearly spaced:

def construct_linspaced_frequencies(num_freqs: int, min_period_len: int, max_period_len: int) -> torch.Tensor:
    freqs = 2 * np.pi / (2 ** np.linspace(np.log2(min_period_len), np.log2(max_period_len), num_freqs)) # [num_freqs]
    freqs = torch.from_numpy(freqs[::-1].copy().astype(np.float32)).unsqueeze(0) # [1, num_freqs]

    return freqs

as the generated sequence satisfies that sigma_{i+1}/sigma_i = C

From my perspective, your code implementation makes more sense, so perhaps you should refine the paper?

universome commented 1 year ago

Hi @johannwyh , I apologize for not replying, I had quite some mess with my projects/deadlines and then lost this thread.

You are right about the error, thank you for point this out. We will update the paper.