# Parameter-Free Ordered Partial Match Alignment with Hidden State Time Warping
## 4 Discussion  
In this section, we discuss the benefits of HSTW compared to previous work, its limitations, and areas of future work.  
The benefits of HSTW can be viewed from two different perspectives. As mentioned earlier, alignment algorithms can be categorized into two groups: trainable alignment methods such as HMMs and parameter-free alignment methods such as DTW. Compared to trainable alignment methods, the main benefit of HSTW is its simplicity and portability: it can be easily adapted to new domains without requiring a cumbersome training process, as we demonstrated with two different tasks in this article. Compared to previous parameter-free alignment methods, the main benefit of HSTW is in its improved handling of non-matching regions (which results in an ordered partial match alignment problem). The most relevant previous parameter-free method is NWTW [20], which allows for horizontal/vertical skips as well as time warping transitions at each position in the cost matrix. While NWTW should in theory be able to handle non-matching regions as a consecutive sequence of horizontal and vertical skips, we see from Figures 2 and 4 that it performed substantially worse than HSTW in handling non-matching regions. Since NWTW and HSTW both allow for the exact same types of transitions, the difference in performance comes from separating the single state (in NWTW) into two distinct states with different time warping characteristics.  
There are two drawbacks to using HSTW. The first drawback is the additional computation and memory requirements compared to standard DTW. Because of the additional hidden plane in the cumulative cost matrix and backtrace matrix, HSTW requires twice as much computation and memory as DTW with the same size cost matrix. Therefore, while HSTW is in theory a generalization of DTW that could be used as a more flexible alternative, in practice its use is only recommended for handling ordered partial match alignment.  
Figure 5: Two example HSTW alignments on the music task. Green and red regions indicate ground truth matching and non-matching regions, respectively. The blue line shows the hidden/visible plane of the optimal path, and the black line shows corresponding costs in the pairwise cost matrix.  
The second drawback is the need to set 2-3 additional hyperparameters beyond those of standard DTW. This can be done with a very small amount of data, however, so this would be considered a relatively minor drawback. Recall that there are three hyperparameters: the skip penalty in the horizontal direction, the skip penalty in the vertical direction, and the plane transition penalty. If the alignment problem is symmetric, however, only two effective hyperparameters need to be set.  
For future work, we plan to generalize HSTW to more than two states. While HSTW explores the use of a hidden and visible state, the concept can readily be extended to multiple states, each having its own time warping characteristics. This would allow one to encode structure a priori into the alignment algorithm while remaining a parameter-free algorithm.  
Conceptualization, T.J.T.; methodology, M.S. and T.J.T.; software, C.C., T.S., A.G., C.L. and M.S.; validation, C.C., T.S., A.G., C.L. and M.S.; writing--original draft preparation, T.J.T.; writing--review and editing, C.C., T.S., A.G., C.L. and M.S.; supervision, T.J.T.; funding acquisition, T.J.T. All authors have read and agreed to the published version of the manuscript.  
This material is based upon work supported by the National Science Foundation under Grant No. 1948531.  
Non-copyrighted data for our experiments can be found at [[https://github.com/HMC-MIR/HSTW](https://github.com/HMC-MIR/HSTW)]([https://github.com/HMC-MIR/HSTW](https://github.com/HMC-MIR/HSTW)) (accessed on 5 April 2022).  
The authors declare that there is no conflict of interest.  
The following abbreviations are used in this manuscript:  
DTW