chickenbestlover / RNN-Time-series-Anomaly-Detection

RNN based Time-series Anomaly detector model implemented in Pytorch.
Apache License 2.0
1.17k stars 316 forks source link

A question about the size of the rnn input emb in function forward #52

Open shaunchen284 opened 9 months ago

shaunchen284 commented 9 months ago

I think there might be a wrong in the model.py.

    def forward(self, input, hidden, return_hiddens=False, noise=False):
        emb = self.drop(self.encoder(input.contiguous().view(-1,self.enc_input_size))) # [(seq_len x batch_size) * feature_size]    
        emb = emb.view(-1, input.size(1), self.rnn_hid_size) # [ seq_len * batch_size * feature_size]

where emb is the input of self.rnn, so I think self.rnn_hid_size should be changed to self.rnn_input_size Looking forward to your reply

shaunchen284 commented 9 months ago

original: emb = emb.view(-1, input.size(1), self.rnn_hid_size) to: emb = emb.view(-1, input.size(1), self.rnn_input_size)