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

很期待您回复,我在这 主要将改为 '--features', 'MS', 和改parser.add_argument('--inverse', default=True),然后报错怎么改 #156

Open
zhurong-dot opened this issue Dec 20, 2024 · 4 comments

Comments

@zhurong-dot
Copy link

command = [
'python', '-u', 'run.py',
'--is_training', '1',
'--root_path', './dataset/ETT-small/',
'--data_path', 'ETTh1.csv',
'--model_id', 'ETTh1_96_96',
'--model', model_name,
'--data', 'ETTh1',
'--features', 'MS',
'--seq_len', '96',
'--pred_len', '96',
'--e_layers', '2',
'--enc_in', '7',
'--dec_in', '7',
'--c_out', '7',
'--des', 'Exp',
'--d_model', '256',
'--d_ff', '256',
'--itr', '1'
]
Traceback (most recent call last):
File "run.py", line 135, in
exp.test(setting)
File "C:\Users\ZRCC\Desktop\kk\iTransformer-main\iTransformer-main\experiments\exp_long_term_forecasting.py", line 235, in test
outputs = test_data.inverse_transform(outputs.squeeze(0)).reshape(shape)
File "C:\Users\ZRCC\Desktop\kk\iTransformer-main\iTransformer-main\data_provider\data_loader.py", line 98, in inverse_transform
return self.scaler.inverse_transform(data)
File "F:\shuoAPP\anaconda\envs\itr\lib\site-packages\sklearn\preprocessing_data.py", line 1052, in inverse_transform
X *= self.scale_
ValueError: non-broadcastable output operand with shape (96,1) doesn't match the broadcast shape (96,7)

@Learntodeath123
Copy link

楼上解决了吗我也遇到了

@THMAIL
Copy link

THMAIL commented Jan 10, 2025

逆标准化失败了而已,你输出维度为96,1自然不可能直接使用96,7的scaler进行恢复,自己做个转换吧

@THMAIL
Copy link

THMAIL commented Jan 10, 2025

用这个来做逆标准化吧
def inverse_result(self, data):
mean_last = self.scaler.mean_[-1]
std_last = self.scaler.scale_[-1]
return data * std_last + mean_last

@tang1tnag
Copy link

楼上解决这个问题了吗?我也遇到了逆归一化没法完成,不清楚如何改?能不能指点一下,具体在哪块代码下面怎么修改

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

4 participants