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

fix the input shape to match (:, timesteps, feature) of keras' lstm #6

Merged
merged 1 commit into from
Nov 22, 2024
Merged

fix the input shape to match (:, timesteps, feature) of keras' lstm #6

merged 1 commit into from
Nov 22, 2024

Conversation

Ginurx
Copy link
Contributor

@Ginurx Ginurx commented Nov 21, 2024

The input shape of an LSTM layer should be a tensor of shape (:, timesteps, feature) as specified in the documentation.

This change ensures that the input shape matches the expected format so that the LSTM layer processes the inputs recurrently over time steps.

Previously, the code passed inputs with the shape (:, 1, look_back), treating each sample as a look_back-dimensional feature vector. This caused the LSTM to function incorrectly.

Impact of the Fix:

Before the fix:
Train Score: 0.50 RMSE
Test Score: 13.97 RMSE

After the fix:
Train Score: 0.50 RMSE
Test Score: 2.27 RMSE

This fix significantly improves the model's performance on the test set, indicating that the LSTM now correctly learns temporal patterns.

@omerbsezer omerbsezer merged commit 72975a4 into omerbsezer:master Nov 22, 2024
@omerbsezer
Copy link
Owner

Thanks

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