sleepwalking / pytorch-softdtw Goto Github PK
View Code? Open in Web Editor NEWAn implementation of SoftDTW for PyTorch.
An implementation of SoftDTW for PyTorch.
I am a greenhand of pytorch, however, I now get x and y of (5089) size. 50 is the length of the array, and 8*9 is the dimension of the feature. How can I operate their dimensions so that I can input the criterion? Thx a lot.
assert len(x.shape) == len(y.shape) squeeze = False if len(x.shape) < 3: x = x.unsqueeze(0) y = y.unsqueeze(0) squeeze = True
Thanks for your contribution, if you can solve my problem I'll be grateful!
Thanks again for your implementation!
Just wanted to let you know that I just released a fast CUDA implementation that's based on your code: https://github.com/Maghoumi/pytorch-softdtw-cuda
I made sure to give you credit and include a link to your repo wherever I included your CPU implementation. If there's any other note in particular that you'd like me to include, please let me know.
I would like to use softdtw for alignment, not as a loss function.
You mention "the derivative is the same as the expected DTW path".
I am new to pytorch, how do I get this derivative? I tried the following,
out = torch.tensor([0.0,0,1,0], requires_grad=True).reshape((1,4,1))
target = torch.tensor([0.0,1,0,0]).reshape((1,4,1))
criterion = SoftDTW(gamma=1.0)
loss = criterion(out, target)
m = loss.backward()
print(m)
which prints "None".
Thank for your source code!
As you said that: "More goodies: check out pytorch-softdtw-cuda by Maghoumi,"
So does it mean this source code is just for CPU computation?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.