|
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?
MSGNet/models/MSGNet.py
Lines 11 to 19 in 953b833
Thanks for this great work! However, the rationale behind the implementation of
FFT_for_Periodmay not be clear.FFT_for_Periodfunction 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..