This example will reimplement the wasserstein distance in 1d. Assume
The p-Wasserstein distance is defined as
where
So the question is how to convert seismic signals to CDFs. For calculating the CDF, a typical way is to convert the data to non-negative values and norm them by the summation, and then apply integration to get the CDF. (I think a better way is to calculate the PDF first, and then integrate the PDF to get the CDF. But I have not implemented the differentiable PDF calculation yet.)
The misfit between a ricker signal and a shifted ricker signal by different loss functions are shown below(You can use ricker.py
to reproduce the figure):
I also compared the effect of normalization on the misfit based on a anomaly model. The results are shown below: