Papers › MMD Aggregated Two-Sample Test

MMD Aggregated Two-Sample Test

28 Oct 2021NeurIPS 2023 11arXiv:2110.15073archive 2025-07-28

Antonin Schrab, Ilmun Kim, Mélisande Albert, Béatrice Laurent, Benjamin Guedj, Arthur Gretton

We propose two novel nonparametric two-sample kernel tests based on the Maximum Mean Discrepancy (MMD). First, for a fixed kernel, we construct an MMD test using either permutations or a wild bootstrap, two popular numerical procedures to determine the test threshold. We prove that this test controls the probability of type I error non-asymptotically. Hence, it can be used reliably even in settings with small sample sizes as it remains well-calibrated, which differs from previous MMD tests which only guarantee correct test level asymptotically. When the difference in densities lies in a Sobolev ball, we prove minimax optimality of our MMD test with a specific kernel depending on the smoothness parameter of the Sobolev ball. In practice, this parameter is unknown and, hence, the optimal MMD test with this particular kernel cannot be used. To overcome this issue, we construct an aggregated test, called MMDAgg, which is adaptive to the smoothness parameter. The test power is maximised over the collection of kernels used, without requiring held-out data for kernel selection (which results in a loss of test power), or arbitrary kernel choices such as the median heuristic. We prove that MMDAgg still controls the level non-asymptotically, and achieves the minimax rate over Sobolev balls, up to an iterated logarithmic term. Our guarantees are not restricted to a specific type of kernel, but hold for any product of one-dimensional translation invariant characteristic kernels. We provide a user-friendly parameter-free implementation of MMDAgg using an adaptive collection of bandwidths. We demonstrate that MMDAgg significantly outperforms alternative state-of-the-art MMD-based two-sample tests on synthetic data satisfying the Sobolev smoothness assumption, and that, on real-world image data, MMDAgg closely matches the power of tests leveraging the use of models such as neural networks.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2110.15073")

Code

Syntology Ran 4 of 15 code samples harvested from 1 repository linked to this paper; 11 have no recorded run. Of those that ran: 1 ran · honoured contract; 3 ran · fixture could not drive it.

By repository: named in the paper: 15 samples from 1 repository, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

antoninschrab/mmdagg officialmentioned on GitHubjax report
antoninschrab/mmdagg-paper mentioned in papermentioned on GitHubjaxMIT report
antoninschrab/fl-mmdagg mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 4 ran; 1 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
3ran · fixture could not drive it
11unverified

Licence: 0 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from antoninschrab/mmdagg-paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

compute_pairwise_matrix antoninschrab/mmdagg-paper/mmdagg/np.py named in the paper ran · fixture could not drive it MIT (permissive) · 139c7796806ebcb2 · report
create_weights antoninschrab/mmdagg-paper/mmdagg/jax.py named in the paper ran · honoured contract MIT (permissive) · ade4e10146ee1a5c · report
kernel_matrix antoninschrab/mmdagg-paper/mmdagg/jax.py named in the paper ran · fixture could not drive it MIT (permissive) · 2c48c4eb0714eef3 · report
kernel_matrix antoninschrab/mmdagg-paper/mmdagg/np.py named in the paper ran · fixture could not drive it MIT (permissive) · 4e7beb2199214856 · report
G antoninschrab/mmdagg-paper/sampling.py named in the paper unverified MIT (permissive) · 74f5342c2c79173c · report
compute_median_bandwidth antoninschrab/mmdagg-paper/median.py named in the paper unverified MIT (permissive) · 7b05376c6740b314 · report
compute_median_bandwidth_subset antoninschrab/mmdagg-paper/median.py named in the paper unverified MIT (permissive) · de5787afebcb8a7c · report
f0 antoninschrab/mmdagg-paper/sampling.py named in the paper unverified MIT (permissive) · 3de090d02c055924 · report
f_theta antoninschrab/mmdagg-paper/sampling.py named in the paper unverified MIT (permissive) · 8f3b20cf3cb686c2 · report
kernel_matrices antoninschrab/mmdagg-paper/kernel.py named in the paper unverified MIT (permissive) · 43b365de0cc59f50 · report
mmdagg antoninschrab/mmdagg-paper/mmdagg/jax.py named in the paper unverified MIT (permissive) · 51da116869a49b91 · report
pairwise_l1_distance antoninschrab/mmdagg-paper/kernel.py named in the paper unverified MIT (permissive) · dac4409612e19fc2 · report
pairwise_square_l2_distance antoninschrab/mmdagg-paper/kernel.py named in the paper unverified MIT (permissive) · a73df06f2cbc35e5 · report
truncated_gaussian antoninschrab/mmdagg-paper/ost.py named in the paper unverified MIT (permissive) · 7da2a914d0ee3daf · report
truncation antoninschrab/mmdagg-paper/ost.py named in the paper unverified MIT (permissive) · b8733b899ab4f726 · report

Tasks

TranslationTwo-sample testingVocal Bursts Valence Prediction

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Test

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections