Skip to content

LSTM and GRU Nan Losses.#3

Open
mohammadjoshaghani wants to merge 3 commits intomainfrom
lstm-error
Open

LSTM and GRU Nan Losses.#3
mohammadjoshaghani wants to merge 3 commits intomainfrom
lstm-error

Conversation

@mohammadjoshaghani
Copy link
Collaborator

@mohammadjoshaghani mohammadjoshaghani commented Dec 5, 2022

Hi, @amirabbasasadi LSTM and GRU creates Nan losses in meta-learning pipeline when using updated requirements.txt
this is because of the last lines of the decoder. I didn't get why it is: Y = 0.5 * (out[:, :, :self.output_size] + out[:, :, self.output_size:]) !
but maybe it would be more precise if it is: Y = 0.5 * (out[:, :, :self.output_size] + out[:, :, self.output_size-1:]). However, this seems it causes issues when time series features are >=2.

@amirabbasasadi
Copy link
Collaborator

Hi, @mohammadjoshaghani
Could you please check this error for the case of bidirectional GRU?
The line that you have mentioned is responsible for averaging the result of two directions since the shape of output_tensor for a bidirectional LSTM is (L, N, D∗H_out​)) where D is the number of directions. I guess the problem is associated with one-directional GRU or LSTM. That line should be applied only when directions==2.

@mohammadjoshaghani
Copy link
Collaborator Author

mohammadjoshaghani commented Dec 6, 2022 via email

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

Successfully merging this pull request may close these issues.

2 participants