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

get_from_one窗口函数 #3

Open
yixinkai123 opened this issue Nov 23, 2024 · 1 comment
Open

get_from_one窗口函数 #3

yixinkai123 opened this issue Nov 23, 2024 · 1 comment

Comments

@yixinkai123
Copy link

yixinkai123 commented Nov 23, 2024

def get_from_one(ts, window_size, stride):
ts_length = ts.shape[0]
print(ts_length)
samples = []
for start in np.arange(0, ts_length, stride):
if start + window_size > ts_length:
break
samples.append(ts[start:start + window_size])
return np.array(samples)
怎么感觉这个窗口化代码有问题呢,比如ts_length=128,windows=8,stride=1
最终代码得到的结果是
[0,1,2,3,4,5,6,7],
[1,2,3,4,5,6,7,8],
[2,3,4,5,6,7,8,9],

[120,121,122,123,124,125,126,127]

这个和你论文中叙述的不一样呀,按照你论文中的操作应该得到是
[0,1,2,3,4,5,6,7]
[8,9,10,11,12,13,14,15]
[16,17,18,19,20,21,22,23]

[120,121,122,123,124,125,126,127]

@Hurongyao
Copy link
Owner

我们做了多次实验,代码中的是效果最好的窗口化方法,没及时说给您带来误解很抱歉。

@Hurongyao Hurongyao reopened this Dec 23, 2024
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