A light-weight repository to compute Amplitude Phase distance between two functions
pip install git+https://github.com/kiranvad/Amplitude-Phase-Distance.git
pip install git+https://github.com/kiranvad/warping.git
pip install git+https://github.com/kiranvad/funcshape.git
You should now be able to run the example
This package is intended to be used as a faster alternative to original works in fdasrsf-python.
If you used this package, please cite the original fdasrsf-python
package using the following:
@phdthesis{tucker2014functional,
title={Functional component analysis and regression using elastic methods},
author={Tucker, J Derek},
year={2014},
school={The Florida State University}
}
For applications in materials science-related problems, you can look at the following papers or repositories linked there:
Introduces amplitude-phase distance to engineering audience and apply it to create a self-driving lab synthesizing gold nanoparticles matching the shape of target UV-Vis spectra.
Introduces functional principle component analysis to UV-Vis spectroscopy data to understand observed trends in shape changes and connect them to molecular design rules of peptide-based gold nanoparticle synthesis.
Introduces shape-based clustering of Small-Angle X-ray Scattering (SAXS) data and use it generate phase maps automatically from high-throughput samples of block-copolymers and blends.
Data-processing is needed as the methods used here are sensitive to data sampling. Theoretically, this should not be the case but in practice, we use techniques such as dynamic programming which works best if we have the unfirom sampling on the X-axis. This is often curcumvented by first fitting a spline to the data and using to make uniform samples.
There are two versions to compute the distance. The default numpy version is from the original fda_srsf
package and is the fastet and should be prefered. The torch version is an attempt to alleviate some of the issues with the numpy version. While the actual definition of distances computed in both versions are the same, they differ in how they approximate the correct warping function. The numpy version using dynamic programing is a discrete approach to obtain the warping function. In the torch method, we instead solve for the warping function by performing an optimization on the function space of warping functions under a particular metric. The mathematical details can be found in this paper. Currently the torch version is experimental and is sometimes known to throw nan values for distances. If that happens, try to re-run the program and it should then be able to converge to a better solution.