ahwillia / affinewarp

An implementation of piecewise linear time warping for multi-dimensional time series alignment
MIT License
162 stars 36 forks source link

Quick question about time factor #18

Closed Wasabi111 closed 2 years ago

Wasabi111 commented 2 years ago

Hi Alex,

Thanks for your help with my last issue. I am currently running the timewarping code and I wonder what the time factor represent. The neuron factor is easy to understand since every neuron signal contributes to the template. But the time factor is more abstract to me. Does it mean how to align the template time bins and clock time bins?

Thanks, Dongming

ahwillia commented 2 years ago

Yes they are the points that define the piecewise linear warping functions mapping clock time to template time.

Wasabi111 commented 2 years ago

Thank you,Alex!

Wasabi111 commented 2 years ago

Hi Alex,

Thanks for your last reply. I have two more questions and I hope you could help me out.

Firstly, I still could not identify the differences between time factor, neuron factor and tau_factors clearly. I find out the time factor has a shape of (time_bins, compoents) and tau has a shape of (trials, time_bins). If time factor maps clock time to template time, which clock time it refers to, the PC clock time? If so, the tau factor would map all trials' clock time to template time. I just want to make sure I get those factors right.

Moreover, I see the loss function defined as RMS between data_predicted and input data. Since the input data remains invariant, the minimal loss and data_predicted should be one-time-determined. I do not understand why iteration of optimization needed.

Thank you very much! Best regards, Dongming

ahwillia commented 2 years ago

What class are you fitting? PiecewiseWarping?

Wasabi111 commented 2 years ago

Nonlinear warping. I am sorry that I made a confusion that my last question was about the TWPCA repository (https://github.com/ganguli-lab/twpca). I should try your new code, but this paper (High-performance brain-to-text communication via handwriting) used your former code.

Wasabi111 commented 2 years ago

I got all the meanings of factors through reading your paper and debugging the code many times. Thanks for your time discussing with me, Alex. Since I have no more question about the time-warp code. I would close this issue. Thank you again for your help!

Dongming