Last active
September 28, 2021 07:30
-
-
Save erap129/843af702a9b3a1100776942342d6a503 to your computer and use it in GitHub Desktop.
NASA RUL project - get lstm results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tqdm import tqdm | |
| def get_predictions_and_labels_lstm(dataset): | |
| predictions = [] | |
| labels = [] | |
| for item in tqdm(test_dataset): | |
| X, y = item | |
| _, output = trained_model(X.unsqueeze(dim=0)) | |
| predictions.append(output.item()) | |
| labels.append(y.item()) | |
| return predictions, labels | |
| print(f'RMSE on train set: {mean_squared_error(*get_predictions_and_labels_lstm(data_module.train_dataset), squared=False)}') | |
| print(f'RMSE on test set: {mean_squared_error(*get_predictions_and_labels_lstm(data_module.test_dataset), squared=False)}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment