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

SoftDTWLoss Training Calculation #23

Open
cvarandia opened this issue May 25, 2020 · 3 comments
Open

SoftDTWLoss Training Calculation #23

cvarandia opened this issue May 25, 2020 · 3 comments

Comments

@cvarandia
Copy link

cvarandia commented May 25, 2020

Hello. Just wanted to clarify.

Is the SoftDTWLoss function designed to accept arrays of time-series? Since during training and testing in Chainer, the loss is computed per batch (true and predicted), the input to the SoftDTWLoss is a batch of time-series labels and predictions. Does the SoftDTWLoss function consider the whole batch as 1 pair of time series or does it treat each pair of time-series (true and predicted) in a batch pair-wise?

Thank you.

@mblondel
Copy link
Owner

Hi! As you can see here, I'm looping over the batch in the example code. So SoftDTWLoss is between two time series, not between two batches of time series. I think back then I made this choice because the batch has to be a Python list (since each time series can have a different length).

@cvarandia
Copy link
Author

So in order to get the loss of the whole batch, I need to iterate over all the sequences in the batch. And for each iteration, I need to reshape each sequence to (-1,1) first before getting the SoftDTWLoss for each pair of sequences to be compared? Thank you for clarifying.

@mblondel
Copy link
Owner

SoftDTWLoss expects time series of shape (length, n_dimensions), so if your time series are one dimensional and have shape (length,), you indeed need a reshape.

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

No branches or pull requests

2 participants