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

[ENH] Add a new distance / similarity measure: DILATE #2539

Open
PavelRechkalov opened this issue Feb 16, 2025 · 8 comments
Open

[ENH] Add a new distance / similarity measure: DILATE #2539

PavelRechkalov opened this issue Feb 16, 2025 · 8 comments
Labels
distances Distances package enhancement New feature, improvement request or other non-bug code enhancement

Comments

@PavelRechkalov
Copy link

Describe the feature or idea you want to propose

Add a new distance measure "Shape and Time Distortion" based on the loss function proposed in this article

It's an elegant way of measuring both Time and Shape distortions

Regards

Describe your proposed solution

Ref1: https://github.com/vincent-leguen/DILATE
Ref2: https://arxiv.org/abs/1909.09020

Describe alternatives you've considered, if relevant

No response

Additional context

No response

@PavelRechkalov PavelRechkalov added the enhancement New feature, improvement request or other non-bug code enhancement label Feb 16, 2025
@SebastianSchmidl SebastianSchmidl added the distances Distances package label Feb 18, 2025
@SalmanDeveloperz
Copy link

Dear Maintainers,
I’d like to work on this and need some clarifications:-

  • Where should the DILATE metric be integrated in the codebase?
  • Should it support both distance and similarity calculations?
  • Are there benchmark datasets or test cases to validate the implementation?
  • Any performance considerations (vectorization, GPU support, preferred libraries)?
  • Which files need modification for proper integration?

Looking forward to your guidance. Thanks

@lucifer4073
Copy link
Contributor

Hi @PavelRechkalov,

I reviewed the paper. DiLATE is a loss function based on soft-DTW distance and a matrix, which is already implemented in aeon.

Are you asking about implementing the loss function in aeon? I am not sure if loss functions are implemented in the distance module. Clarficiation would help

@chrisholder
Copy link
Contributor

Hi @SalmanDeveloperz, @lucifer4073 makes a good point - are you wanting to implement the loss function or a specific model that uses the loss function?

We already have soft-DTW which I believe is the main component of the loss function. I haven't read the paper in a huge amount of detail but isn't the loss function just soft-DTW? Maybe I misunderstood.

If you want to add the loss function itself, we don't really have a dedicated area for loss functions to exist currently but it could be an interesting addition. @hadifawaz1999 what do you think is best to do with loss functions like this in aeon?

@hadifawaz1999
Copy link
Member

@chrisholder the loss function itself wouldn't be interesting alone as it should come with a backbone model for a specific task, clustering classification regression etc. So integration of the model that uses it would be the good addition, Haven't read the paper yet so i still don't know what's the downstream task.

@hadifawaz1999
Copy link
Member

it seems to be for forecasting, i recall now attending the talk of that paper in Paris when Nicolas presented it,so whenever we start with deep learning for forecasting (the upcoming GSoC) it would be a great addition

@SalmanDeveloperz
Copy link

Hey @hadifawaz1999 , @lucifer4073,

Appreciate the insights. Given that DILATE builds on soft-DTW (already implemented), would it be more meaningful to integrate it within a forecasting model rather than as a standalone loss function?

Also, since deep learning for forecasting is in the pipeline for GSoC, aligning this contribution with that roadmap could maximize its impact.I aim to contribute meaningfully, ensuring long-term impact while aligning with future initiatives like GSoC.
Would appreciate your thoughts on the best approach.

Best,
Salman

@PavelRechkalov
Copy link
Author

PavelRechkalov commented Feb 24, 2025

Greetings folks,

I am happy to see that this thread created such a healthy discussion.

The way I understand DILATE is a weighted sum of two sub-functions:

  1. Shape similarity - Calculated via DTW
  2. Temporal misalignment estimation - Calculated via Time Distortion Index (TDI)

@lucifer4073 Is the above method equals the Soft-DTW you are talking about?

Edit:

Here's the DILATE implementation by the paper author: https://github.com/vincent-leguen/DILATE/tree/master/loss

@hadifawaz1999
Copy link
Member

Given the GSoC we have for forecasting, this could be the next target after finishing up the basics that GSoC has as goal, then it would be great to have this model in, model+loss.
It will depend on how fast the GSoC advances with what we have in the to do list, but if not it will be the contribution after GSoC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distances Distances package enhancement New feature, improvement request or other non-bug code enhancement
Projects
None yet
Development

No branches or pull requests

6 participants