跳转到主要内容
Calcton

Wasserstein Distance Calculator

Free online wasserstein distance calculator. Enter your values and get instant results with the formula, step-by-step working, a worked example and FAQs — everything runs locally in your browser on Calcton, no signup required.

中文版:一维 Wasserstein 距离计算器

Wasserstein Distance Calculator
分布 p(逗号分隔,等距网格上的概率质量,和为 1)
分布 q(逗号分隔,项数相同)

原理:一维 Wasserstein-1 距离(推土机距离)等于两分布累积分布函数之差的绝对值积分:W1 = Σ|F_p(i) − F_q(i)|·Δ,本工具取等距网格 Δ = 1。它的直观图像是把 p 的「土方」搬到 q 的位置所需的最小功。

步骤:① 按网格顺序输入两个概率质量向量;② 点击计算;③ 读出 W1。

示例:p = (0.2, 0.3, 0.5)、q = (0.5, 0.3, 0.2) 时 W1 = 0.6;p = (0.1, 0.9)、q = (0.9, 0.1) 时 W1 = 0.8;p = (0.1, 0.2, 0.7)、q = (0.4, 0.1, 0.5) 时 W1 = 0.5。

注意事项:输入必须按网格位置顺序排列且等距——顺序颠倒结果无意义;W1 不要求两分布支撑对齐到同长以外的网格精度;与 KL/TV 不同,W1 感知「距离结构」——质量搬得越远罚得越重;生成模型的 WGAN 直接最小化本距离的神经网络版。

相关:总变差距离计算器忽略几何位置只看逐项差;Jensen-Shannon 计算器给出对数度量口径;正态分布计算器可配合做连续分布的直观比较。

How to use the Wasserstein Distance Calculator

  1. Fill in the inputs with your own numbers — every field shows what it expects.
  2. The result updates instantly as you type; no "Calculate" click needed.
  3. Read the result card for the main figure, the step-by-step formula, and practical notes.

Frequently asked questions

Is the Wasserstein Distance Calculator free?

Yes — all math calculators on Calcton are free, with no sign-up required. Your inputs are processed in your browser and never sent to a server.

Is there a Chinese version of this tool?

Yes. Use the Chinese version link above — it is the same calculator with the interface in Simplified Chinese.

References

Formulas and benchmarks used by this calculator follow these published sources.

  1. dlmf.nist.gov
  2. mathworld.wolfram.com
Kevin's profile

KevinContent LeadCalcton Editorial Team · Last updated 2026-10-06

Kevin maintains Calcton's formula verification and content: every calculator cites the standard it implements, worked examples are recomputed programmatically, and health benchmarks follow WHO and international guidelines.

Related calculators

More in this category: Math calculators

About math calculators

Free online math calculators for algebra, statistics, number theory and everyday arithmetic — from quadratic equations and matrices to percentages, fractions and prime factorization, each with step-by-step formulas.

搜索计算器

搜索全站计算器、分类与页面,回车直达