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

Feat/onnx support #2620

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Feat/onnx support #2620

wants to merge 12 commits into from

Conversation

madtoinou
Copy link
Collaborator

@madtoinou madtoinou commented Dec 17, 2024

Checklist before merging this PR:

  • Mentioned all issues that this PR fixes or addresses.
  • Summarized the updates of this PR under Summary.
  • Added an entry under Unreleased in the Changelog.

Fixes #553, fixes #2617.

Summary

  • Small refactoring of the _process_input_batch and _get_batch_prediction() methods to make the behavior uniform across PLModules
  • Added to_onnx method to the TorchForecastingModel class, taking care of creating the input_names and input_sample based on the model attributes
  • Added a section in the User Guide to show how to export and load the model to generate forecasts

Other Information

The consistency of the forecasts was tested in a notebook for all the possible configurations, I did not implement unit-test as onnx should remain an optional dependency. Let me know what you think.

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 39.39394% with 20 lines in your changes missing coverage. Please review.

Project coverage is 93.98%. Comparing base (71a1902) to head (22ea061).

Files with missing lines Patch % Lines
...arts/models/forecasting/torch_forecasting_model.py 5.55% 17 Missing ⚠️
darts/models/forecasting/pl_forecasting_module.py 75.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2620      +/-   ##
==========================================
- Coverage   94.15%   93.98%   -0.18%     
==========================================
  Files         139      139              
  Lines       14992    15017      +25     
==========================================
- Hits        14116    14113       -3     
- Misses        876      904      +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

How do I export a darts' TCNModel to ONNX? ONNX Support
1 participant