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

[minor] Memory optimized stride function #1400

Merged
merged 2 commits into from
Aug 15, 2023
Merged

Conversation

leoniewgnr
Copy link
Collaborator

🔬 Background

def _stride_time_features_for_forecasts(x) uses a lot of memory

🔮 Key changes

replace with np.lib.stride_tricks.as_strided

@github-actions
Copy link

github-actions bot commented Aug 14, 2023

Model Benchmark

Benchmark Metric main current diff
YosemiteTemps MAE_val 1.3442 1.3442 0.0%
YosemiteTemps RMSE_val 2.00245 2.00245 0.0%
YosemiteTemps Loss_val 0.00077 0.00077 0.0%
YosemiteTemps MAE 1.3192 1.3192 0.0%
YosemiteTemps RMSE 2.13518 2.13518 0.0%
YosemiteTemps Loss 0.00064 0.00064 0.0%
YosemiteTemps time 58.4559 57.93 -0.9%
PeytonManning MAE_val 0.58159 0.58159 0.0%
PeytonManning RMSE_val 0.72216 0.72216 0.0%
PeytonManning Loss_val 0.01239 0.01239 0.0%
PeytonManning MAE 0.41671 0.41671 0.0%
PeytonManning RMSE 0.55961 0.55961 0.0%
PeytonManning Loss 0.00612 0.00612 0.0%
PeytonManning time 11.4212 12.32 7.87%
AirPassengers MAE_val 13.0626 13.0626 0.0%
AirPassengers RMSE_val 15.9453 15.9453 0.0%
AirPassengers Loss_val 0.00131 0.00131 0.0%
AirPassengers MAE 9.88156 9.88156 0.0%
AirPassengers RMSE 11.7354 11.7354 0.0%
AirPassengers Loss 0.00052 0.00052 0.0%
AirPassengers time 4.9221 5.18 5.24% ⚠️
Model training plots

Model Training

PeytonManning

YosemiteTemps

AirPassengers

@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Merging #1400 (19cebdb) into main (4c31824) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1400      +/-   ##
==========================================
+ Coverage   89.84%   89.85%   +0.01%     
==========================================
  Files          38       38              
  Lines        5061     5068       +7     
==========================================
+ Hits         4547     4554       +7     
  Misses        514      514              
Files Changed Coverage Δ
neuralprophet/time_dataset.py 95.54% <100.00%> (+0.10%) ⬆️

Copy link
Collaborator

@noxan noxan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement on readability and performance 👍

@leoniewgnr leoniewgnr marked this pull request as ready for review August 15, 2023 16:03
@leoniewgnr leoniewgnr self-assigned this Aug 15, 2023
@leoniewgnr leoniewgnr added the status: ready PR is ready to be merged label Aug 15, 2023
@leoniewgnr leoniewgnr merged commit d236471 into main Aug 15, 2023
@leoniewgnr leoniewgnr deleted the memory-efficient-stride branch August 15, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready PR is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants