Skip to content

Question in FFT_for_Period #23

Description

@CharmsGraker

MSGNet/models/MSGNet.py

Lines 11 to 19 in 953b833

def FFT_for_Period(x, k=2):
# [B, T, C]
xf = torch.fft.rfft(x, dim=1)
frequency_list = abs(xf).mean(0).mean(-1)
frequency_list[0] = 0
_, top_list = torch.topk(frequency_list, k)
top_list = top_list.detach().cpu().numpy()
period = x.shape[1] // top_list
return period, abs(xf).mean(-1)[:, top_list]

Thanks for this great work! However, the rationale behind the implementation of FFT_for_Period may not be clear.

  • In my opinion, the FFT_for_Period function is used for frequency selection, which is a necessary preprocessing step for the multi-scale modeling described in the paper. It returns the scale sizes with corresponding top-k largeset amp..
  • However, in line 14, the frequency selection is based on the TS averaging across batches, which may not be appropriate during testing. How would model performance be influenced if the calculation were done on a per-sample manner?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions