-
Notifications
You must be signed in to change notification settings - Fork 466
New Metric: Soft Dynamic Time Warping
(Soft-DTW)
#3287
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
base: master
Are you sure you want to change the base?
New Metric: Soft Dynamic Time Warping
(Soft-DTW)
#3287
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@Borda Just wanted to get your initial opinion on this before I move forward. The softDTW uses dynamic programming which makes it really slow to work with on cpus. It's runs faster on gpus. Do you think it's worth continuing the effort? |
I think it is very fine to have only the GPU version and raise an exception or a warning on the CPU |
Soft Dtw Loss
[WIP]Soft Dtw Loss
[WIP]
Soft Dtw Loss
[WIP]Soft Dynamic Time Warping
(Soft-DTW)
raise ValueError("Batch size of preds and target must be the same.") | ||
if preds.shape[2] != target.shape[2]: | ||
raise ValueError("Feature dimension of preds and target must be the same.") | ||
if not isinstance(gamma, float) or gamma <= 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's try to convert it to float? e.g. an int can also be a float and a float-tensor or similar would be fine? Also is there an upper bound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the float check. Int will be accepted now. Also, there's no upper bound to gamma.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@justusschock I'm looking at the unittest results. Turns out it's erroring out:
The pysdtw library used as reference needs it. Is there any way around it? |
What does this PR do?
Fixes #3084
Before submitting
PR review
Added a new domain called timeseries to include Soft DTW loss.
Ref paper: https://arxiv.org/abs/1703.01541
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃
📚 Documentation preview 📚: https://torchmetrics--3287.org.readthedocs.build/en/3287/