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

关于classification代码中一处意味不明的小错误 #29

Open
doc-ycm opened this issue Feb 26, 2024 · 1 comment
Open

关于classification代码中一处意味不明的小错误 #29

doc-ycm opened this issue Feb 26, 2024 · 1 comment

Comments

@doc-ycm
Copy link

doc-ycm commented Feb 26, 2024

class gpt4ts(nn.Module):类中,有以下embedding模块定义
self.enc_embedding = DataEmbedding(self.feat_dim * self.patch_size, config['d_model'], config['dropout'])
该定义声明直接导致类对象生成时

class DataEmbedding(nn.Module):
    def __init__(self, c_in, d_model, embed_type='fixed', freq='h', dropout=0.1):
        super(DataEmbedding, self).__init__()
        self.value_embedding = TokenEmbedding(c_in=c_in, d_model=d_model)
        self.position_embedding = PositionalEmbedding(d_model=d_model)
        self.temporal_embedding = TemporalEmbedding(d_model=d_model, embed_type=embed_type,
                                                    freq=freq) if embed_type != 'timeF' else TimeFeatureEmbedding(
            d_model=d_model, embed_type=embed_type, freq=freq)

该形参embed_type值为config['dropout'],即错误赋值,其变成了一个float对象

进一步导致了self.temporal_embedding定义逻辑出现问题

但是由于在模型在forward函数中
outputs = self.enc_embedding(input_x, None)
第二个形参为None,因此并未对实际运行逻辑产生影响

@doc-ycm doc-ycm changed the title 关于classification代码错误的问题 关于classification代码中一处意味不明的小错误的问题 Feb 26, 2024
@doc-ycm doc-ycm changed the title 关于classification代码中一处意味不明的小错误的问题 关于classification代码中一处意味不明的小错误 Feb 26, 2024
@PSacfc
Copy link
Collaborator

PSacfc commented Mar 14, 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