diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..03d3504b5471e5fe27c2e55d3e306920498d6ae2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,35 +1,6 @@ -*.7z filter=lfs diff=lfs merge=lfs -text -*.arrow filter=lfs diff=lfs merge=lfs -text -*.bin filter=lfs diff=lfs merge=lfs -text -*.bz2 filter=lfs diff=lfs merge=lfs -text -*.ckpt filter=lfs diff=lfs merge=lfs -text -*.ftz filter=lfs diff=lfs merge=lfs -text -*.gz filter=lfs diff=lfs merge=lfs -text -*.h5 filter=lfs diff=lfs merge=lfs -text -*.joblib filter=lfs diff=lfs merge=lfs -text -*.lfs.* filter=lfs diff=lfs merge=lfs -text -*.mlmodel filter=lfs diff=lfs merge=lfs -text -*.model filter=lfs diff=lfs merge=lfs -text -*.msgpack filter=lfs diff=lfs merge=lfs -text -*.npy filter=lfs diff=lfs merge=lfs -text -*.npz filter=lfs diff=lfs merge=lfs -text -*.onnx filter=lfs diff=lfs merge=lfs -text -*.ot filter=lfs diff=lfs merge=lfs -text -*.parquet filter=lfs diff=lfs merge=lfs -text -*.pb filter=lfs diff=lfs merge=lfs -text -*.pickle filter=lfs diff=lfs merge=lfs -text -*.pkl filter=lfs diff=lfs merge=lfs -text -*.pt filter=lfs diff=lfs merge=lfs -text -*.pth filter=lfs diff=lfs merge=lfs -text -*.rar filter=lfs diff=lfs merge=lfs -text -*.safetensors filter=lfs diff=lfs merge=lfs -text -saved_model/**/* filter=lfs diff=lfs merge=lfs -text -*.tar.* filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text *.tar filter=lfs diff=lfs merge=lfs -text -*.tflite filter=lfs diff=lfs merge=lfs -text -*.tgz filter=lfs diff=lfs merge=lfs -text -*.wasm filter=lfs diff=lfs merge=lfs -text -*.xz filter=lfs diff=lfs merge=lfs -text -*.zip filter=lfs diff=lfs merge=lfs -text -*.zst filter=lfs diff=lfs merge=lfs -text -*tfevents* filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.svg filter=lfs diff=lfs merge=lfs -text +source_current.tar.gz filter=lfs diff=lfs merge=lfs -text +source_v1.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/AUDIT_PLAN.md b/AUDIT_PLAN.md new file mode 100644 index 0000000000000000000000000000000000000000..51cf9cae5fbba3b1fc1804a2f4b5f2bbc54a59e8 --- /dev/null +++ b/AUDIT_PLAN.md @@ -0,0 +1,40 @@ +# Audit plan: Gradient Flow Sampler-based Distributionally Robust Optimization + +- OpenReview: `QRtzkKrbJi` +- arXiv: `2510.25956` +- Intended Space: `ProCreations/repro-gradient-flow-sampler-based-distributionally-robust-optimization` +- Literal registry source: arXiv v1. The current revision changes the outer-loop + rate from `O(epsilon_opt^-2)` to `O(epsilon_opt^-4)` and the WGF total + complexity from `epsilon_opt^-4` to `epsilon_opt^-6`; it is a drift control, + not evidence for the registered v1 claims. + +## Evidence design + +1. Pin v1/current PDF and source archives and verify six exact live claim + anchors in the complete v1 source. +2. Inventory the six concrete gradient-flow/DRO algorithms directly from the + v1 labels and captions. +3. Reproduce Proposition 1's logarithmic flow-time threshold exactly on a + Gaussian Wasserstein gradient flow across many `(lambda, L, epsilon)` + settings, with an early-stop destructive control. +4. Audit Theorem 1 and Theorem 2 by evaluating their explicit rate laws across + grids of tolerances, dimensions, and smoothness/LSI constants. These finite + identities do not replace the universal v1 proofs. +5. Reconstruct the half-bridge Gibbs conditional on discrete supports and + verify the fixed marginal, normalization, KKT residual, and worst-case + mixture identity. +6. Preserve the three primary CIFAR-10 PGD figures and the exact source + statement that WFR/WGF remain robust across the reported settings. This is + source-reported evidence; no smaller synthetic run will be mislabeled as a + CIFAR/ResNet reproduction. +7. Run two isolated warning-strict executions, require byte-identical outputs, + package one replay, build a recursive SHA-256 manifest, run the official + validator, and test every static route before publication. + +## Fail-closed scope + +The v1/current theory drift is material and must remain visible. Claim 5 is +supported by the pinned primary experiment figures and source discussion, not +by invented numeric curve extraction. The Gaussian and discrete calculations +are exact mechanism audits and are not substitutes for the source's universal +theorems or CIFAR experiment. diff --git a/BUNDLE_SHA256SUMS.txt b/BUNDLE_SHA256SUMS.txt new file mode 100644 index 0000000000000000000000000000000000000000..6cb3471fc6ae850ed3bc459701814f04540137f2 --- /dev/null +++ b/BUNDLE_SHA256SUMS.txt @@ -0,0 +1,111 @@ +bb94f6aa7a9cbad0ba16dae2bc73a20007e8848f658a6f0031f67a4d371b9364 .gitattributes +7b05dd9492dc62c142adc1b132d9c673d529b894045364629a8ee87dc0c58238 AUDIT_PLAN.md +10d84413bc5c1a69a49476e9459f960eec44ed79cfca34cd3832eddac36986b1 README.md +9e17fec689decf67e63cae0dd34cd2689e6206a4247bfeab142a011e7c5a94c1 SOURCE_PIN.txt +d1c28fc0a4e07f2688d013f576cf76ffc422d278d56a52a82989e0b93b3b3964 bucket-icon.svg +19c284cda088f64959844fc1684cc87607455e25b19af8b29374a774f8877e9f build_manifest.py +e9554f12747f04f2c3cf1a9329d95887bcd2277103a7a70037ffcecbbfbc2e9f cifar_pgd_epsilon_0.002.pdf +cd76d8b7a3aa740b779254df2586a2969e6779ffc90ad6275de70432fc5bc3d5 cifar_pgd_epsilon_0.02.pdf +2718528cba70f770a0470f77e239bd00b1647ff0ee944734b75a2ecae257cd04 cifar_pgd_epsilon_0.2.pdf +6d77484b11bcdda07f373501c51c5762ddee81162ac334703eb21cf44e9fded4 index.html +64e1de4358c79ec0d5f2697c56f98258c025e992c94ad7b3b7801739222ca41d logbook.css +69d73869184f936613668569980f31984be65229e77c4df4ba9604d3de70c02b logbook.js +6ce9167b37f98c342ddc0bc13526351fe7cc3c6c2daf6929192eecd605acb5ac logbook.json +87764175f0cfcf2c6f24823892e08ca3bcf4213ad9b54e5b0e4446edb8490756 official_claims.json +5d4380db39ca6bde371e10062203926c97f5fd0840c83cea409091f6c3ea6cea outputs/SHA256SUMS.json +119618048b6d87a10a131e4d83de1829d7605a68d00a22a64357b79ef1977a8e outputs/complexity_rates.csv +f3678af8a9b6709b48adf9afaaadf13b00d20ec04e0aa9b60e6972cb8882f118 outputs/flow_time_thresholds.csv +da21f3b485717953200ccbb9ff2fa570c46b672ac6194b073b8ac0b800e70440 outputs/gradient_flow_dro_audit.png +152875bc7db70b9fda675d64fd972bfb39d5bf1ac62a8ed354f9060e9762458e outputs/half_bridge_gibbs.csv +c425618b40180887a9cb7c211ca34eb58eac3de5ad0655b517108afde83154d5 outputs/results.json +824c826b13f22f3b1cfe7b908b6295e699adf7afa50f35990cc677cce732060d outputs/source_and_algorithm_audit.csv +1c9c8ff953a428235b4d93333c07859da3b5e91ae504194dbaae7261e39eead9 outputs/source_cifar_figures.csv +5d4380db39ca6bde371e10062203926c97f5fd0840c83cea409091f6c3ea6cea packaged_replay/SHA256SUMS.json +119618048b6d87a10a131e4d83de1829d7605a68d00a22a64357b79ef1977a8e packaged_replay/complexity_rates.csv +f3678af8a9b6709b48adf9afaaadf13b00d20ec04e0aa9b60e6972cb8882f118 packaged_replay/flow_time_thresholds.csv +da21f3b485717953200ccbb9ff2fa570c46b672ac6194b073b8ac0b800e70440 packaged_replay/gradient_flow_dro_audit.png +152875bc7db70b9fda675d64fd972bfb39d5bf1ac62a8ed354f9060e9762458e packaged_replay/half_bridge_gibbs.csv +c425618b40180887a9cb7c211ca34eb58eac3de5ad0655b517108afde83154d5 packaged_replay/results.json +824c826b13f22f3b1cfe7b908b6295e699adf7afa50f35990cc677cce732060d packaged_replay/source_and_algorithm_audit.csv +1c9c8ff953a428235b4d93333c07859da3b5e91ae504194dbaae7261e39eead9 packaged_replay/source_cifar_figures.csv +5a9e8862c60fd9390583af52355dbb70ab33f17fb4a281911693977f665ec610 pages/claim-1-six-algorithms/page.md +ddba04cf3c0f43aa176366c9fb4aacc911b00d067a7b654bb46730a99eaebdde pages/claim-2-flow-time/page.md +244ab0b0bf4f1f2c5c6c5e5a972bd9f1ffea5a842f6ed0587efe0e6df864d417 pages/claim-3-outer-loop/page.md +96b19f89a152908edc3c976d458808cd00f6164b2f8388a832761f1fe744294c pages/claim-4-total-complexity/page.md +85f17d7c0beaf78054f63182a72597f264153d94e8f315cdfe6a7f9ce900adfa pages/claim-5-cifar-robustness/page.md +5170ce86198e92a0c0ecd5346f1cd616f58d6cf698636ef00cd2c2338aa888d3 pages/claim-6-half-bridge/page.md +008e5a942ef3b944c300136cc950238f1543262f2e6728db712a7ebb8b5f431f pages/conclusion/page.md +f772e30930924c63f06c00291bb3518d1f7ded401c138297852e3666bf651114 pages/executive-summary/page.md +a07556e68ed0fc98253fdc87161101029079be0100cc3887e555c6919ec9ba4e pages/index.md +88720453447d8affcefd3e63097c52f512d5b275766ba3e73dff9af2ca1c0f8f paper_current.pdf +796d3cb25e2a9062ab4e81201daa7837c4bf615399063b0ed439c9e17e6db8d6 paper_v1.pdf +53a0a0e15e8efe9e00af9e9555183807f23f0361da2924ecffc7b76a5ccec073 poster_embed.html +96ed5db257e18985f91acfe4529bacb2295d1cfcf5f44aa1355613f0a2c8449f reproduce.py +18d9327b4ec19517d71a96ac807565af43b11b8132569ddbf660aec191f7fa8d requirements.txt +d1f6b1a71c9accb812ec5121d1fff7910c025ca7bb201948bacdb40941bc14e5 source_current/00README.json +d301f140970834e394d3003901163ee4e3a5b41509cd4c056c9a961812befd9d source_current/1_exp_convergence.pdf +0c7d35d3c873fc8400c7dfaa4f6ee82fe31ae7c6bcd8f676defdc94a3cb0cb9b source_current/2000.pdf +2d922bd1ee56d03355fcb6d99e1b6d1abbe70c6a723ce63c7fd7325c690310b4 source_current/Bibliography.bib +36fd7e11e6b3f3b7ee54a881f4a392f42a20e50f287e690df77d81ef8082064f source_current/WFR_frame_000_samples.pdf +8a931335efc08220437d320dd12d23a1f4a26849dadb6ff361864bd322bcae08 source_current/WRM_frame_000_samples.pdf +02109e3aa4ae40713ac15e51da5115de84b6056a92d9235ee22cafcd59c64ca8 source_current/arxiv.sty +72be5a52fcc74e8f11cf8e7c57c0622c38dec1f07db85ecf009b9c8e08506848 source_current/boundary_5_0.01.pdf +8454585a39aec6a2eff484ef2e2b53ad1295724f8cfd04085243f27723c5f832 source_current/circle_boundary_comparison.pdf +de4a873a0320d50e2635aecc5202fbece17ce4fe1296149fa76c007908ade633 source_current/exp_convergence.pdf +8bc60518357260750e769f10a02ee935e90c7f18f16797b0337f8dc87f6aa972 source_current/exp_epsilon.pdf +e3bc6b3adad7aa3d062799b9bf89ba10ac0d0f77e95058d432f0b9d24dc553b2 source_current/exp_lr.pdf +c9a3f86d38902255ba2cf9d62464cf511dac61f49a34d60086041625e4f2b462 source_current/exp_num_samples.pdf +210a06b8ade1ff37ecba8bf56cfd96fb6bb1b2febdfdc84ac59e7c25a8f5a66a source_current/exp_tau.pdf +b56ec4434b9f4607529a4b23dc68ad8d4b94f1f631c8cddaf7da78140d53a5ea source_current/fancyhdr.sty +6e3af5d048af03dbf2ee22560590d19dae055c7ec68a6bd4c710bdebe32390d8 source_current/frame_020.pdf +d33e3ee01f8df8e37d3cda6a806c5574b4e1d97e956efedb87e728429169173c source_current/frame_100.pdf +4d19fcf87c2ff1af69accaeb6b2b6b699a2ae72fce656f42576275e1a4d3b034 source_current/frame_288.pdf +249ac738759c8b7ab92417072a6c345403d041ace6321231d0fa8a5dcea43e43 source_current/loss_curves.pdf +9870222918f4232dcc09731f1edac156f245ff2ab03190aef0a69c5117eacb40 source_current/main.tex +cd6d8ab7f5449d3a6f5f769209970b0b2f1e7e004bd5491a6287c27d271f5287 source_current/original.pdf +ae46893be793deb8ad162e067ea16c3c4fc435396e1d6d49b1295fc741429de0 source_current/perturbed_top3.pdf +6bc256a293a15460c08f0f04fae33afc4ddea9eb09c528a35a5e56b82b8b8da7 source_current/preamble-JZ.sty +66d5860f3e3ec6b77148de1f69901a2376d6ffa8fb1074994f532050d3fe11ff source_current/rgo_frame.pdf +e9554f12747f04f2c3cf1a9329d95887bcd2277103a7a70037ffcecbbfbc2e9f source_current/rgo_lam=10_eps=0.002.pdf +cd76d8b7a3aa740b779254df2586a2969e6779ffc90ad6275de70432fc5bc3d5 source_current/rgo_lam=10_eps=0.02.pdf +2718528cba70f770a0470f77e239bd00b1647ff0ee944734b75a2ecae257cd04 source_current/rgo_lam=10_eps=0.2.pdf +9d6fc982ffe219e0510abfaeda4e5b48c428b1ca2a28dda1edf343ffe13aa7bc source_current/saa_perturb_objective_comparison.pdf +0a842d6f6c4e9e373973ff79ac39a05cd15d02db574e4f2075d54b571da40e04 source_current/svg_frame_0.1.pdf +62b346a72ad7b4d14bd2771afac4cc721a67f7542d6e572467ce003e7163fcfa source_current/svg_frame_0.2.pdf +7d5daf60fbe02c131402019f6f26940b723d123609f6befef700210d9a08cec9 source_current/uncertain_least_squares_results.pdf +9d1935af30b285970385eca6ad62348ec3b7435b8c02f14901bf561d3792cbe7 source_current/wfr_frame.pdf +dced0ff411affb535f885926966e932ae4ffdbae8b1a26fde50fe4ec122cda33 source_current/wfr_multi_sample_results.pdf +6d4eef7bc6543ecc602ce7170e92c3d2ae98ce6c53d2d9757031f49a69addfce source_current/wfr_topk_comparison.pdf +30fd4db5832678bb4f4189cab7c01295a48a598dd259c9df37e6322690305a4d source_current/wgf_frame.pdf +aeb51c0af1cfc1062a1487c9d4229a6bfbc316f817f18acb8d2251041ab82651 source_current/wrm_frame.pdf +cc00b5195a2592b24f9b876bf9fd27ada78fa9a46c468e81221983943cb726e5 source_current.tar.gz +dd6420871809422ca61692c24496259ed754b47e96bfcaa467a796ceeacc7e0a source_v1/00README.json +0c7d35d3c873fc8400c7dfaa4f6ee82fe31ae7c6bcd8f676defdc94a3cb0cb9b source_v1/2000.pdf +2c4cc26aced0b7e927d3ca1f54c4f88c3f0080690a587fd89ab73198533f0414 source_v1/Bibliography.bib +36fd7e11e6b3f3b7ee54a881f4a392f42a20e50f287e690df77d81ef8082064f source_v1/WFR_frame_000_samples.pdf +8a931335efc08220437d320dd12d23a1f4a26849dadb6ff361864bd322bcae08 source_v1/WRM_frame_000_samples.pdf +011a4870ca65ef14244487549707ab9d813f2a3302fc060bd1e839bfbffb3676 source_v1/arxiv.sty +72be5a52fcc74e8f11cf8e7c57c0622c38dec1f07db85ecf009b9c8e08506848 source_v1/boundary_5_0.01.pdf +8454585a39aec6a2eff484ef2e2b53ad1295724f8cfd04085243f27723c5f832 source_v1/circle_boundary_comparison.pdf +b56ec4434b9f4607529a4b23dc68ad8d4b94f1f631c8cddaf7da78140d53a5ea source_v1/fancyhdr.sty +6e3af5d048af03dbf2ee22560590d19dae055c7ec68a6bd4c710bdebe32390d8 source_v1/frame_020.pdf +d33e3ee01f8df8e37d3cda6a806c5574b4e1d97e956efedb87e728429169173c source_v1/frame_100.pdf +4d19fcf87c2ff1af69accaeb6b2b6b699a2ae72fce656f42576275e1a4d3b034 source_v1/frame_288.pdf +8072755853b19384894f9f340dc17663bb9725fc717797b6084d2e1509bccfe1 source_v1/main.bbl +51a7f7309a58464113d1fe68059858e7e5da4c92e0d88bd7b96561827674db63 source_v1/main.tex +d50120f265fbb2492ba04d14bdd1326bed2b4cac589a324939234c0c9c894d5f source_v1/preamble-JZ.sty +66d5860f3e3ec6b77148de1f69901a2376d6ffa8fb1074994f532050d3fe11ff source_v1/rgo_frame.pdf +e9554f12747f04f2c3cf1a9329d95887bcd2277103a7a70037ffcecbbfbc2e9f source_v1/rgo_lam=10_eps=0.002.pdf +cd76d8b7a3aa740b779254df2586a2969e6779ffc90ad6275de70432fc5bc3d5 source_v1/rgo_lam=10_eps=0.02.pdf +2718528cba70f770a0470f77e239bd00b1647ff0ee944734b75a2ecae257cd04 source_v1/rgo_lam=10_eps=0.2.pdf +9d6fc982ffe219e0510abfaeda4e5b48c428b1ca2a28dda1edf343ffe13aa7bc source_v1/saa_perturb_objective_comparison.pdf +0a842d6f6c4e9e373973ff79ac39a05cd15d02db574e4f2075d54b571da40e04 source_v1/svg_frame_0.1.pdf +62b346a72ad7b4d14bd2771afac4cc721a67f7542d6e572467ce003e7163fcfa source_v1/svg_frame_0.2.pdf +7d5daf60fbe02c131402019f6f26940b723d123609f6befef700210d9a08cec9 source_v1/uncertain_least_squares_results.pdf +9d1935af30b285970385eca6ad62348ec3b7435b8c02f14901bf561d3792cbe7 source_v1/wfr_frame.pdf +30fd4db5832678bb4f4189cab7c01295a48a598dd259c9df37e6322690305a4d source_v1/wgf_frame.pdf +aeb51c0af1cfc1062a1487c9d4229a6bfbc316f817f18acb8d2251041ab82651 source_v1/wrm_frame.pdf +35a471bd60c11517db90b8e337064019c5a07faa621718aeca9800d425604488 source_v1.tar.gz +a6eb72253c0128ce79b526a86b7943eed37beec186b5f57ff6c1701d0e9ff596 trackio-logo-light.png +3e3792061d4d095759da30d7cfe7f14b621901793cd4d677b61b2896f5bf472b trackio-logo.png +71da94795855710d214801eb9b9b7b8898e9a8757abac0e22966a0531bbb2f4f trackio-wordmark-dark.png diff --git a/README.md b/README.md index 5ee3701b500b691d7a1b35c8520c4b94158120f5..cda63ba9b451875164a2863c0557232ddbf0ce06 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,25 @@ --- -title: Repro Gradient Flow Sampler Based Distributionally Robust Optimization -emoji: 🐠 -colorFrom: purple -colorTo: pink +title: "Reproduction - Gradient Flow Sampler-based Distributionally Robust Optimization" +emoji: 🎯 +colorFrom: blue +colorTo: indigo sdk: static pinned: false +tags: + - trackio + - trackio-logbook + - open-experiment + - icml2026-repro + - paper-QRtzkKrbJi --- -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +# Gradient-flow DRO reproduction + +A version-locked proof, rate, flow-time, half-bridge, and primary-experiment audit for all six registered claims. + +```bash +python3 -m pip install -r requirements.txt +PYTHONWARNINGS=error python3 reproduce.py --output-dir replay-check +``` + +The three CIFAR-10 PGD plots are pinned primary v1 artifacts. The exact Gaussian and discrete calculations independently audit mechanisms and are not mislabeled as CIFAR reruns or universal proofs. diff --git a/SOURCE_PIN.txt b/SOURCE_PIN.txt new file mode 100644 index 0000000000000000000000000000000000000000..9dc63e850429dc5d4f92dfab97e08cc503748175 --- /dev/null +++ b/SOURCE_PIN.txt @@ -0,0 +1,11 @@ +Paper: Gradient Flow Sampler-based Distributionally Robust Optimization +OpenReview: QRtzkKrbJi +ArXiv: 2510.25956 + +Literal registry source: arXiv v1 +v1 PDF SHA-256: 796d3cb25e2a9062ab4e81201daa7837c4bf615399063b0ed439c9e17e6db8d6 +v1 source SHA-256: 35a471bd60c11517db90b8e337064019c5a07faa621718aeca9800d425604488 +current PDF SHA-256: 88720453447d8affcefd3e63097c52f512d5b275766ba3e73dff9af2ca1c0f8f +current source SHA-256: cc00b5195a2592b24f9b876bf9fd27ada78fa9a46c468e81221983943cb726e5 + +V1 exactly matches the registered O(epsilon_opt^-2) outer-loop and O-tilde(epsilon_opt^-4) WGF total-complexity claims. The current revision changes these to epsilon_opt^-4 and epsilon_opt^-6 and is a disclosed drift control only. diff --git a/bucket-icon.svg b/bucket-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..b7ce1dac0d70d7ca8e392aff3a534b756041708d --- /dev/null +++ b/bucket-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/build_manifest.py b/build_manifest.py new file mode 100644 index 0000000000000000000000000000000000000000..7b9381fdd3c45b45b665411aa518f5502d222af4 --- /dev/null +++ b/build_manifest.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +from __future__ import annotations +import hashlib +from pathlib import Path +ROOT=Path(__file__).resolve().parent; OUT=ROOT/'BUNDLE_SHA256SUMS.txt' +def digest(path): + h=hashlib.sha256() + with path.open('rb') as f: + for block in iter(lambda:f.read(1<<20),b''): h.update(block) + return h.hexdigest() +rows=[] +for path in sorted(ROOT.rglob('*')): + if path.is_file() and path!=OUT and '__pycache__' not in path.parts and 'replay-check' not in path.parts: rows.append(f"{digest(path)} {path.relative_to(ROOT).as_posix()}") +OUT.write_text('\n'.join(rows)+'\n',encoding='utf-8'); print(f"wrote {len(rows)} entries to {OUT.name}") diff --git a/cifar_pgd_epsilon_0.002.pdf b/cifar_pgd_epsilon_0.002.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fa1d25664f9972d2165b92054be4bfcc8adbc2dd Binary files /dev/null and b/cifar_pgd_epsilon_0.002.pdf differ diff --git a/cifar_pgd_epsilon_0.02.pdf b/cifar_pgd_epsilon_0.02.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f42743659e336aafa2b0ce6cf0ac38fa1f9b18d6 Binary files /dev/null and b/cifar_pgd_epsilon_0.02.pdf differ diff --git a/cifar_pgd_epsilon_0.2.pdf b/cifar_pgd_epsilon_0.2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6345403de0d9c6238a08aead1e2ab31b0a49ad3c Binary files /dev/null and b/cifar_pgd_epsilon_0.2.pdf differ diff --git a/index.html b/index.html index b0c4b3666032a737f3903db53e6a8a9272483e28..a645c53ced6feba1c9af47c7a54b5b57dbd9b6af 100644 --- a/index.html +++ b/index.html @@ -1,19 +1,54 @@ - - - - - My static Space - - - -
-

Welcome to your static Space!

-

You can modify this app directly by editing index.html in the Files and versions tab.

-

- Also don't forget to check the - Spaces documentation. -

-
- + + + + + Reproduction: Gradient Flow Sampler-based Distributionally Robust Optimization + + + +
+ +
+
+
+
+ + + + + diff --git a/logbook.css b/logbook.css new file mode 100644 index 0000000000000000000000000000000000000000..2a9f174dac3117978fa2279dacebce2185fe6694 --- /dev/null +++ b/logbook.css @@ -0,0 +1,1602 @@ +:root { + --bg: #ffffff; + --paper: #fdfcf9; + --panel: #ffffff; + --ink: #1f2937; + --muted: #6b7280; + --line: #e5e7eb; + --accent: #f97316; + --accent-strong: #ea580c; + --accent-soft: #fff7ed; + --accent-line: rgba(249, 115, 22, 0.16); + --grid-line: rgba(31, 41, 55, 0.045); + --code-bg: #f3f4f6; + --radius: 12px; + --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif; + --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, + sans-serif; + --mono: "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, + ui-monospace, monospace; +} + +* { + box-sizing: border-box; +} + +html, +body { + margin: 0; + padding: 0; +} + +html { + scroll-behavior: smooth; +} + +body { + background: var(--bg); + color: var(--ink); + font-family: var(--sans); + font-size: 13px; + line-height: 1.65; + -webkit-font-smoothing: antialiased; +} + +#app { + display: flex; + min-height: 100vh; +} + +/* ---- sidebar (composition-book cover) ---- */ +#sidebar { + width: 280px; + flex: 0 0 280px; + background: #17181c; + color: #e7e7ea; + position: sticky; + top: 0; + height: 100vh; + overflow-y: auto; + padding: 22px 16px; + display: flex; + flex-direction: column; +} + +#book-head { + display: flex; + align-items: center; + gap: 10px; + padding: 8px; + margin-bottom: 12px; + border-radius: 10px; + cursor: pointer; + transition: background 0.12s; +} +#book-head:hover { + background: rgba(255, 255, 255, 0.05); +} +#book-wordmark { + width: 154px; + height: auto; + object-fit: contain; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} + +#tree { + flex: 1; + padding-top: 8px; +} + +#tree a { + display: block; + padding: 6px 10px; + border-radius: 8px; + color: #c3c4cb; + text-decoration: none; + font-size: 14px; + transition: background 0.12s, color 0.12s; +} + +#tree a:hover { + background: rgba(255, 255, 255, 0.06); + color: #ffffff; +} + +#tree a.active { + background: rgba(249, 115, 22, 0.16); + color: #fdba74; + font-weight: 600; +} + +#tree a .tree-mark { + color: #6b6d76; +} + +#tree a:hover .tree-mark, +#tree a.active .tree-mark { + color: inherit; + opacity: 0.6; +} + +#tree .depth-1 { + padding-left: 22px; +} +#tree .depth-2 { + padding-left: 34px; +} +#tree .depth-3 { + padding-left: 46px; +} + + +/* ---- content ---- */ +#content { + flex: 1; + min-width: 0; + padding: 48px 40px 120px; + background-color: var(--paper); + background-image: + linear-gradient(var(--grid-line) 1px, transparent 1px), + linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); + background-size: 26px 26px; + background-position: center top; +} + +#page { + width: 100%; + min-width: 0; + max-width: 1052px; + margin: 0 auto; +} + +.page-section { + scroll-margin-top: 40px; + padding: 0 0 35px; + margin: 0 0 32px; +} + +.page-section:last-child { + margin-bottom: 0; +} + +.page-layout { + display: grid; + grid-template-columns: minmax(0, 760px) 248px; + gap: 44px; + align-items: start; +} + +.page-body { + min-width: 0; +} + +.resource-anchor { + display: block; + height: 0; + overflow: hidden; +} + +/* ---- pinned notes ---- */ +.pinned-notes { + margin: 30px 0 0; +} +.pinned-notes-list .cell { + margin: 0; + border-color: rgba(249, 115, 22, 0.55); +} +.pinned-notes-list .cell + .cell { + margin-top: 12px; +} +.cell.pinned-source { + border-color: rgba(249, 115, 22, 0.55); +} +.book-intro.has-pinned-notes { + border-bottom: none; + padding-bottom: 22px; + margin-bottom: 30px; +} +.book-intro.book-intro-tight { + border-bottom: none; + padding-bottom: 4px; + margin-bottom: 20px; +} + +#page h1 { + font-family: var(--serif); + font-size: 34px; + line-height: 1.15; + letter-spacing: -0.02em; + margin: 0 0 8px; + overflow-wrap: anywhere; +} + +#page .page-section:not(.book-intro) h1 { + font-size: 26px; +} + +#page h2 { + font-family: var(--serif); + font-size: 24px; + margin: 36px 0 10px; +} + +#page h3 { + font-size: 17px; + font-weight: 700; + margin: 26px 0 2px; + letter-spacing: -0.01em; +} + +#page h3::before { + content: ""; + display: inline-block; + width: 7px; + height: 7px; + border-radius: 2px; + background: var(--accent); + margin-right: 10px; + vertical-align: middle; + transform: translateY(-1px); +} + +#page p { + margin: 10px 0; +} + +#page blockquote { + margin: 14px 0; + padding: 2px 16px; + border-left: 3px solid #fdba74; + color: var(--muted); +} + +#page hr { + display: none; +} + +#page code { + font-family: var(--mono); + font-size: 0.86em; + background: var(--code-bg); + padding: 2px 6px; + border-radius: 6px; +} + +#page pre { + max-width: 100%; + background: var(--code-bg); + border: 1px solid var(--line); + border-radius: var(--radius); + padding: 14px 16px; + overflow-x: auto; +} +#page pre code { + background: none; + padding: 0; + font-size: 11.5px; +} + +/* ---- code blocks + collapsible accordion ---- */ +#page pre.hl { + background: #17181c; + border: none; + color: #e7e7ea; + font-size: 13px; + line-height: 1.58; +} +#page pre.hl code { + color: inherit; + font-family: var(--mono); +} +.code-accordion { + border: 1px solid rgba(249, 115, 22, 0.2); + border-radius: 8px; + overflow: hidden; + margin: 12px 0; + background: #17181c; +} +.code-accordion summary { + list-style: none; + cursor: pointer; + display: flex; + align-items: center; + gap: 9px; + padding: 9px 12px; + font-family: var(--mono); + font-size: 11.5px; + font-weight: 700; + color: #e7e7ea; + background: #1e2027; + user-select: none; + overflow-wrap: anywhere; +} +.code-accordion summary::-webkit-details-marker { + display: none; +} +.code-accordion summary::after { + content: "▸"; + margin-left: auto; + color: var(--accent); + transition: transform 0.12s; + transform: rotate(180deg); +} +.code-accordion[open] summary::after { + transform: rotate(90deg); +} +.code-accordion .code-ico { + color: var(--accent); + font-weight: 700; +} +.code-accordion pre.hl { + margin: 0; + border-radius: 0; + border: none; + border-top: 1px solid rgba(249, 115, 22, 0.16); +} +.tok-comment { + color: #7a7d87; + font-style: italic; +} +.tok-string { + color: #a5d6a7; +} +.tok-keyword { + color: #fdba74; +} +.tok-number { + color: #7fd0e0; +} + +#page a { + color: var(--accent); +} + +#page ul { + padding-left: 20px; +} + +.ts { + font-family: var(--mono); + font-size: 12px; + color: var(--muted); + background: none; + padding: 0; +} + +/* ---- notebook-style cells ---- */ +.cell { + max-width: 100%; + border: 1px solid var(--line); + border-radius: 10px; + background: rgba(255, 255, 255, 0.86); + margin: 18px 0; + overflow: hidden; + box-shadow: 0 2px 10px rgba(31, 41, 55, 0.035); +} +.cell-head { + display: flex; + justify-content: space-between; + gap: 16px; + align-items: center; + padding: 14px 18px; + background: rgba(255, 255, 255, 0.92); + border-bottom: 1px solid var(--line); +} +.cell-head.no-title { + justify-content: flex-end; + padding-top: 10px; + padding-bottom: 10px; +} +.cell-title { + flex: 1; + min-width: 0; + font-size: 13px; + font-weight: 650; + color: var(--ink); + line-height: 1.35; + overflow-wrap: anywhere; +} +.cell-meta { + flex: 0 0 auto; + display: flex; + align-items: center; + gap: 10px; + font-family: var(--sans); + font-size: 13px; + color: var(--muted); +} +.cell-open { + flex: 0 0 auto; + font-family: var(--mono); + font-size: 12px; + color: var(--accent); + text-decoration: none; +} +.cell-open:hover { + color: var(--accent-strong); +} +.cell-body { + min-width: 0; + padding: 14px 18px 18px; +} +.cell.dashboard .cell-body { + padding: 0; +} +#page .cell-body h1, +#page .cell-body h2 { + font-family: var(--sans); + font-size: 17px; + font-weight: 700; + letter-spacing: -0.01em; + line-height: 1.35; + margin: 22px 0 6px; +} +#page .cell-body > :first-child { + margin-top: 0; +} +#page .cell-body > :last-child { + margin-bottom: 0; +} +.cell.code .cell-head { + background: #fbfbfc; +} +.figure-fit { + position: relative; + overflow: hidden; + min-height: 160px; + border: 1px solid var(--line); + border-radius: 8px; + background: #fff; +} +.figure-fit[hidden] { + display: none; +} +.figure-fit:fullscreen, +.figure-fit:-webkit-full-screen { + width: 100%; + height: 100%; + border: none; + border-radius: 0; +} +.figure-frame { + display: block; + width: 100%; + min-height: 160px; + border: none; + background: #fff; +} +.figure-frame[hidden], +.figure-raw[hidden] { + display: none; +} +.fig-switch { + position: relative; + display: inline-flex; + flex: 0 0 auto; + border: 1px solid var(--line); + border-radius: 999px; + background: var(--code-bg); + padding: 2px; +} +.fig-switch button { + position: relative; + z-index: 1; + flex: 1; + min-width: 62px; + border: none; + background: none; + font-family: var(--sans); + font-size: 12px; + font-weight: 600; + color: var(--muted); + padding: 3px 12px; + border-radius: 999px; + cursor: pointer; + transition: color 0.15s; +} +.fig-switch button.active { + color: var(--accent-strong); +} +.fig-switch-thumb { + position: absolute; + top: 2px; + bottom: 2px; + left: 2px; + width: calc(50% - 2px); + border-radius: 999px; + background: var(--panel); + border: 1px solid rgba(249, 115, 22, 0.35); + box-shadow: 0 1px 4px rgba(31, 41, 55, 0.08); + transition: transform 0.18s ease; +} +.fig-switch.raw .fig-switch-thumb { + transform: translateX(100%); +} +#page .figure-raw pre { + margin: 0; + max-height: 420px; + overflow: auto; + font-family: var(--mono); + font-size: 13px; + line-height: 1.55; + background: var(--code-bg); + border: 1px solid var(--line); + border-radius: 8px; + padding: 12px 14px; +} +/* ---- figure fullscreen ---- */ +.cell-fullscreen { + position: relative; + display: inline-flex; + flex: 0 0 auto; +} +.cell-fullscreen-btn { + display: inline-flex; + align-items: center; + justify-content: center; + width: 26px; + height: 26px; + padding: 0; + border: 1px solid var(--line); + border-radius: 999px; + background: var(--code-bg); + color: var(--muted); + cursor: pointer; + transition: color 0.15s, border-color 0.15s, background 0.15s; +} +.cell-fullscreen-btn:hover { + color: var(--accent-strong); + border-color: rgba(249, 115, 22, 0.35); + background: var(--accent-soft); +} +.cell-fullscreen-btn svg { + width: 14px; + height: 14px; +} +/* ---- copyable snippets ---- */ +.snippet { + position: relative; +} +.copy-snippet { + position: absolute; + top: 7px; + right: 8px; + width: 24px; + height: 24px; + border: none; + border-radius: 6px; + background: rgba(255, 255, 255, 0.08); + color: #9a9da8; + font-size: 12px; + line-height: 1; + cursor: pointer; + opacity: 0; + transition: opacity 0.12s, color 0.12s, background 0.12s; +} +.snippet:hover .copy-snippet, +.jp-out:hover .copy-snippet, +.figure-raw:hover .copy-snippet, +.code-accordion summary:hover .copy-snippet { + opacity: 1; +} +.copy-snippet:hover { + color: #ffffff; + background: rgba(255, 255, 255, 0.16); +} +.copy-snippet.copied { + color: #52d08a; + opacity: 1; +} +.code-accordion .code-name { + user-select: text; + cursor: text; +} +.jp-out, +.figure-raw { + position: relative; +} +.jp-out .copy-snippet, +.figure-raw .copy-snippet { + background: var(--code-bg); + color: var(--muted); + border: 1px solid var(--line); +} +.jp-out .copy-snippet:hover, +.figure-raw .copy-snippet:hover { + color: var(--accent-strong); + background: var(--panel); +} + +/* ---- jupyter-style code cells ---- */ +.jp { + border: 1px solid var(--line); + border-radius: 10px; + overflow: hidden; + margin: 12px 0; + background: var(--panel); +} +.jp-gutter { + flex: 0 0 46px; + padding: 13px 0 0 13px; + font-family: var(--mono); + font-size: 10.5px; + letter-spacing: 0.07em; + text-transform: uppercase; + font-weight: 600; + user-select: none; +} +.jp-in { + display: flex; + background: #17181c; +} +.jp-in .jp-gutter { + color: #6f727d; +} +.jp-in-body { + flex: 1; + min-width: 0; +} +#page .jp-in-body pre.hl { + margin: 0; + border: none; + border-radius: 0; + background: none; + padding: 12px 16px 12px 0; +} +.jp-in-body .code-accordion { + margin: 0; + border: none; + border-top: 1px solid rgba(255, 255, 255, 0.09); + border-radius: 0; + background: none; +} +.jp-in-body .code-accordion summary { + background: none; + padding: 9px 16px 9px 0; +} +.jp-in-body .code-accordion pre.hl { + border-top: 1px solid rgba(255, 255, 255, 0.09); +} +.jp-meta { + padding: 5px 14px; + font-family: var(--mono); + font-size: 11.5px; + color: var(--muted); + background: #fbfbfc; + border-top: 1px solid var(--line); +} +.jp-out { + display: flex; + border-top: 1px solid var(--line); + background: var(--panel); +} +.jp-out .jp-gutter { + color: var(--accent-strong); +} +.jp-out-body { + flex: 1; + min-width: 0; +} +#page .jp-out-pre { + min-width: 0; + margin: 0; + border: none; + border-radius: 0; + background: none; + color: var(--ink); + font-family: var(--mono); + font-size: 13px; + line-height: 1.55; + padding: 12px 16px 12px 0; + white-space: pre; + overflow-x: auto; + overflow-y: auto; + max-height: 26em; +} +.jp-artifacts { + display: flex; + flex-direction: column; +} +.jp-out-body .jp-out-pre + .jp-artifacts { + border-top: 1px solid var(--line); +} +.out-artifact { + display: flex; + align-items: baseline; + gap: 8px; + padding: 9px 16px 9px 0; + text-decoration: none; + color: inherit; +} +.out-artifact + .out-artifact { + border-top: 1px solid var(--line); +} +a.out-artifact:hover .out-artifact-name { + color: var(--accent-strong); +} +.out-artifact-ico { + flex: 0 0 auto; + font-size: 13px; +} +.out-artifact-name { + font-family: var(--mono); + font-size: 12.5px; + font-weight: 600; + color: var(--ink); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.out-artifact-meta { + flex: 0 0 auto; + margin-left: auto; + padding-left: 12px; + font-size: 12px; + color: var(--muted); + white-space: nowrap; +} +.out-artifact-state.open { + color: var(--accent); + font-weight: 600; +} +.trackio-embed { + border: 1px solid var(--line); + border-radius: var(--radius); + overflow: hidden; + background: var(--panel); +} +.trackio-cell-meta { + display: flex; + gap: 6px; + flex-wrap: wrap; + justify-content: flex-end; +} + +/* ---- unfurl cards ---- */ +.unfurl { + display: block; + border: 1px solid var(--line); + border-radius: var(--radius); + background: var(--panel); + margin: 12px 0; + overflow: hidden; + text-decoration: none; + color: inherit; + transition: border-color 0.14s, box-shadow 0.14s; +} +.unfurl:hover { + border-color: #cfcbe6; + box-shadow: 0 4px 18px rgba(30, 20, 80, 0.06); +} + +.unfurl-body { + padding: 13px 16px; + display: flex; + gap: 12px; + align-items: flex-start; +} + +.unfurl-ico { + font-size: 20px; + line-height: 1.3; + flex: 0 0 auto; +} + +.unfurl-main { + min-width: 0; + flex: 1; +} + +.unfurl-kind { + font-family: var(--mono); + font-size: 10.5px; + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--accent); + font-weight: 600; +} + +.unfurl-title { + font-weight: 650; + font-size: 15px; + margin: 1px 0 2px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.unfurl-desc { + color: var(--muted); + font-size: 13.5px; + line-height: 1.45; +} + +.unfurl-meta { + margin-top: 6px; + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.chip { + font-size: 11.5px; + background: var(--code-bg); + border-radius: 999px; + padding: 2px 9px; + color: var(--muted); + font-family: var(--mono); +} + +.unfurl-raw { + font-family: var(--mono); + font-size: 11px; + color: var(--muted); + border-top: 1px solid var(--line); + padding: 7px 16px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.unfurl.embed { + padding: 0; + overflow: hidden; +} +.embed-head { + display: flex; + align-items: center; + gap: 10px; + padding: 10px 14px; + border-bottom: 1px solid var(--line); +} +.embed-head .unfurl-kind { + flex: 0 0 auto; +} +.embed-title { + flex: 1; + min-width: 0; + font-weight: 650; + font-size: 14px; + color: var(--ink); + text-decoration: none; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.embed-title:hover { + color: var(--accent); +} +.embed-open { + flex: 0 0 auto; + font-family: var(--mono); + font-size: 12px; + color: var(--accent); + text-decoration: none; +} +.embed-frame { + display: block; + width: 100%; + height: 560px; + border: 0; + background: var(--code-bg); +} + +.dashboard-shell { + display: block; +} +.dashboard-shell .dashboard-frame { + display: block; + width: 100%; + height: 900px; + border: 0; + background: var(--code-bg); +} + +.unfurl.image { + padding: 0; +} +.unfurl.image img { + display: block; + width: 100%; + height: auto; + max-height: 460px; + object-fit: contain; + background: var(--code-bg); +} + +.artifact-chip { + border: 1px solid var(--line); + background: var(--panel); + border-radius: var(--radius); + padding: 10px 14px; + margin: 8px 0; + font-size: 14px; +} +.cell.dashboard .artifact-chip { + margin: 14px 18px 18px; +} +.artifact-chip code { + color: var(--accent); +} + +/* ---- task board ---- */ +.board-wrap { + overflow-x: auto; + border: 1px solid var(--line); + border-radius: var(--radius); + margin: 12px 0 20px; + background: var(--panel); +} +table.board { + border-collapse: collapse; + width: 100%; + font-size: 14px; +} +table.board th, +table.board td { + text-align: left; + padding: 9px 14px; + border-bottom: 1px solid var(--line); + vertical-align: top; +} +table.board thead th { + background: var(--accent-soft); + font-size: 12px; + text-transform: uppercase; + letter-spacing: 0.05em; + color: #9a4a12; + font-weight: 600; + border-bottom: 1px solid var(--line); +} +table.board tbody tr:last-child td { + border-bottom: none; +} +table.board .col-check { + text-align: center; + width: 92px; + white-space: nowrap; +} +table.board tr.section-row td { + background: var(--accent-soft); + text-align: center; + font-weight: 700; + font-size: 13px; + color: var(--accent-strong); + padding: 7px 14px; + letter-spacing: 0.02em; +} +.box { + display: inline-flex; + align-items: center; + justify-content: center; + width: 18px; + height: 18px; + border: 1.5px solid #cfcbe0; + border-radius: 5px; + font-size: 12px; + color: #fff; + line-height: 1; +} +.box.on { + background: var(--accent); + border-color: var(--accent); +} +.who-chip { + display: inline-block; + padding: 3px 12px; + border-radius: 999px; + font-size: 12.5px; + font-weight: 600; + white-space: nowrap; +} +.who-chip.muted { + background: var(--code-bg); + color: var(--muted); + font-weight: 500; +} + +/* ---- status badges + clickable rows ---- */ +table.board .col-status { + width: 130px; + white-space: nowrap; +} +.badge { + display: inline-block; + padding: 3px 11px; + border-radius: 999px; + font-size: 12px; + font-weight: 600; + letter-spacing: 0.01em; +} +.badge.gray { + background: var(--code-bg); + color: var(--muted); +} +.badge.amber { + background: var(--accent-soft); + color: #b45309; +} +.badge.green { + background: #e6f7ee; + color: #1a8a55; +} +.badge.red { + background: #fde8ec; + color: #c62a4b; +} +table.board tr.linked-row { + cursor: pointer; +} +table.board tr.linked-row:hover td { + background: var(--accent-soft); +} +table.board tr.linked-row a { + color: var(--ink); + font-weight: 600; + text-decoration: none; +} +table.board tr.linked-row:hover a { + color: var(--accent-strong); +} + +/* ---- agent read hint ---- */ +.agent-hint { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8px; + margin: 4px 0 22px; + font-size: 12.5px; + color: var(--muted); +} +#page .agent-hint code { + background: var(--code-bg); + padding: 2px 9px; + border-radius: 6px; + font-family: var(--mono); + font-size: 12px; + font-weight: 500; + color: var(--ink); +} +.agent-hint .copy { + flex: 0 0 auto; + background: none; + color: var(--muted); + border: 1px solid var(--line); + border-radius: 6px; + width: 22px; + height: 22px; + font-size: 11px; + line-height: 1; + cursor: pointer; + transition: color 0.12s, border-color 0.12s; +} +.agent-hint .copy:hover { + color: var(--accent-strong); + border-color: var(--accent); +} +.agent-hint .copy.copied { + color: #1a8a55; + border-color: #1a8a55; +} +.agent-hint-note { + margin-left: auto; + font-size: 12px; + color: var(--muted); +} + +/* ---- logbook summary stats ---- */ +.logbook-stats { + display: flex; + flex-wrap: wrap; + gap: 12px; + margin: 0 0 28px; +} +.stat-tile { + position: relative; + display: inline-flex; + align-items: center; + gap: 11px; + border: 1px solid var(--line); + background: var(--panel); + border-radius: var(--radius); + padding: 12px 23px; + font: inherit; + text-align: left; + cursor: pointer; + transition: border-color 0.12s, box-shadow 0.12s; +} +.stat-tile:hover:not([disabled]) { + border-color: rgba(249, 115, 22, 0.45); + box-shadow: 0 3px 12px rgba(31, 41, 55, 0.06); +} +.stat-tile:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; +} +.stat-tile[disabled] { + cursor: default; + opacity: 0.7; +} +.stat-tile.open { + border-color: rgba(249, 115, 22, 0.6); + box-shadow: 0 3px 12px rgba(31, 41, 55, 0.08); +} +.stat-icon { + width: 24px; + height: 24px; + flex: 0 0 24px; + object-fit: contain; + align-self: center; +} +.stat-text { + display: flex; + align-items: baseline; + gap: 8px; + white-space: nowrap; + line-height: 1; +} +.stat-num { + font-family: var(--mono); + font-size: 20px; + font-weight: 600; + line-height: 1; + color: var(--accent-strong); +} +.stat-label { + font-size: 15px; + line-height: 1; + color: var(--muted); +} +.stat-caret { + margin-left: 2px; + font-size: 10px; + color: var(--muted); + align-self: center; + transition: transform 0.12s; +} +.stat-tile.open .stat-caret { + transform: rotate(180deg); +} +.stat-popover { + position: absolute; + top: 100%; + left: 0; + margin-top: 6px; + min-width: 300px; + max-width: min(460px, 92vw); + max-height: 340px; + overflow-y: auto; + z-index: 20; + background: var(--panel); + border: 1px solid var(--line); + border-radius: var(--radius); + box-shadow: 0 8px 28px rgba(31, 41, 55, 0.12); + padding: 6px; +} +.stat-popover[hidden] { + display: none; +} +.stat-pop-head { + padding: 6px 10px 8px; + font-size: 11.5px; + font-weight: 700; + letter-spacing: 0.03em; + text-transform: uppercase; + color: var(--muted); +} +.stat-row { + display: flex; + align-items: flex-start; + gap: 10px; + padding: 9px 11px; + border-radius: 9px; + border: 1px solid transparent; + text-decoration: none; + color: inherit; + cursor: pointer; +} +.stat-row:hover { + border-color: rgba(249, 115, 22, 0.4); + background: var(--accent-soft); +} +.stat-row-ico { + font-size: 15px; + line-height: 1.3; + flex: 0 0 auto; +} +.stat-row-main { + min-width: 0; + flex: 1; +} +.stat-row-title { + font-family: var(--mono); + font-size: 12.5px; + font-weight: 600; + color: var(--ink); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.stat-row-meta { + margin-top: 2px; + font-size: 12px; + color: var(--muted); +} +.stat-row-state.open { + color: var(--accent); + font-weight: 600; + border-radius: 5px; + padding: 1px 5px; + margin: -1px -2px; +} +.stat-row-state.open:hover { + background: rgba(249, 115, 22, 0.14); + text-decoration: underline; +} +.art-ico { + width: 1em; + height: 1em; + object-fit: contain; + vertical-align: -0.15em; +} + +/* ---- scroll-to-resource highlight ---- */ +.res-flash { + animation: res-flash 1.5s ease; + border-radius: 8px; +} +@keyframes res-flash { + 0%, + 25% { + box-shadow: 0 0 0 3px var(--accent); + } + 100% { + box-shadow: 0 0 0 3px rgba(249, 115, 22, 0); + } +} + +/* ---- inline resource chips ---- */ +#page .res-chip { + display: inline-flex; + align-items: center; + gap: 5px; + max-width: 100%; + padding: 0 9px 0 6px; + margin: 0 1px; + border: 1px solid var(--line); + border-radius: 999px; + background: var(--panel); + font-family: var(--mono); + font-size: 0.78em; + font-weight: 600; + color: var(--ink); + text-decoration: none; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: middle; + line-height: 1.65; + transform: translateY(-0.08em); + transition: border-color 0.12s, background 0.12s, color 0.12s; +} +.res-chip-ico { + font-size: 1.05em; + line-height: 1; +} +#page .res-chip:hover, +#page .res-chip.res-hl { + border-color: var(--accent); + background: var(--accent-soft); + color: var(--accent-strong); +} +#page a.res-link.res-hl { + background: var(--accent-soft); + border-radius: 4px; +} +.rail-item.res-hl { + border-color: var(--accent); + background: var(--accent-soft); + box-shadow: 0 3px 12px rgba(249, 115, 22, 0.14); +} +.rail-item.res-hl .rail-title { + color: var(--accent-strong); +} +.rail-item.rail-local { + cursor: default; +} +.artifact-chip.res-hl { + border-color: var(--accent); + background: var(--accent-soft); +} + +/* ---- contextual resources rail ---- */ +.context-rail { + position: relative; + width: 248px; +} +.context-rail[hidden] { + display: none; +} +.rail-kind { + display: flex; + align-items: center; + gap: 5px; + font-family: var(--mono); + font-size: 10px; + text-transform: uppercase; + letter-spacing: 0.08em; + font-weight: 600; + color: var(--accent); + margin-bottom: 4px; +} +.rail-item { + position: absolute; + left: 0; + right: 0; + display: block; + border: 1px solid var(--line); + border-radius: 10px; + background: var(--panel); + padding: 9px 12px; + margin-bottom: 8px; + text-decoration: none; + color: inherit; + transition: border-color 0.14s, box-shadow 0.14s; +} +.rail-item:hover { + border-color: rgba(249, 115, 22, 0.45); + box-shadow: 0 3px 12px rgba(31, 41, 55, 0.06); +} +.rail-title { + font-family: var(--mono); + font-size: 12.5px; + font-weight: 600; + color: var(--ink); + overflow-wrap: anywhere; + line-height: 1.4; +} +.rail-item:hover .rail-title { + color: var(--accent-strong); +} +.rail-meta { + font-size: 11.5px; + color: var(--muted); + margin-top: 2px; +} + +@media (max-width: 1400px) { + .page-layout { + display: block; + } + .context-rail { + width: 100%; + margin-top: 28px; + position: static; + min-height: 0 !important; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + gap: 10px; + } + .context-rail[hidden] { + display: none; + } + .context-rail .rail-item { + position: static; + margin-bottom: 0; + } +} + +/* ---- connect footer + modal ---- */ +#sidebar-foot { + margin-top: auto; + padding-top: 14px; + border-top: 1px solid rgba(255, 255, 255, 0.1); +} + +#connect-btn { + width: 100%; + display: flex; + align-items: center; + gap: 8px; + background: rgba(255, 255, 255, 0.05); + color: #c3c4cb; + border: 1px solid rgba(255, 255, 255, 0.12); + border-radius: 9px; + padding: 9px 12px; + font-size: 13.5px; + font-family: var(--sans); + cursor: pointer; + transition: background 0.12s, color 0.12s, border-color 0.12s; +} +#connect-btn:hover { + background: rgba(249, 115, 22, 0.14); + border-color: rgba(249, 115, 22, 0.4); + color: #fdba74; +} +#connect-btn .ico { + font-size: 15px; +} + +#modal[hidden] { + display: none; +} +#modal { + position: fixed; + inset: 0; + z-index: 100; + display: flex; + align-items: center; + justify-content: center; + padding: 24px; +} +.modal-backdrop { + position: absolute; + inset: 0; + background: rgba(20, 18, 30, 0.5); + backdrop-filter: blur(2px); +} +.modal-card { + position: relative; + background: var(--panel); + border-radius: 16px; + width: 100%; + max-width: 620px; + max-height: 85vh; + overflow-y: auto; + box-shadow: 0 24px 70px rgba(20, 15, 50, 0.28); +} +.modal-head { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + padding: 18px 22px; + border-bottom: 1px solid var(--line); + position: sticky; + top: 0; + background: var(--panel); +} +.modal-title { + display: flex; + align-items: center; + gap: 10px; + font-family: var(--serif); + font-size: 21px; + letter-spacing: -0.01em; +} +.modal-logo { + width: 26px; + height: 26px; + object-fit: contain; +} +.modal-actions { + display: flex; + align-items: center; + gap: 8px; +} +.btn { + font-family: var(--sans); + font-size: 13.5px; + font-weight: 600; + border: 1px solid var(--line); + background: var(--panel); + color: var(--ink); + border-radius: 9px; + padding: 8px 13px; + cursor: pointer; + transition: background 0.12s, border-color 0.12s, color 0.12s; +} +.btn:hover { + border-color: var(--accent); + color: var(--accent-strong); +} +.btn.copied { + border-color: #1a8a55; + color: #1a8a55; +} +.btn.icon { + font-size: 18px; + line-height: 1; + padding: 6px 11px; + font-weight: 400; +} +.modal-body { + padding: 20px 22px 26px; +} +.modal-intro { + margin: 0 0 20px; + color: var(--muted); + line-height: 1.55; +} +#connect-steps { + list-style: none; + margin: 0; + padding: 0; +} +#connect-steps li { + margin-bottom: 18px; +} +.step-title { + font-weight: 600; + font-size: 14.5px; + margin-bottom: 8px; +} +.codeblock { + display: flex; + align-items: center; + gap: 8px; + background: #17181c; + border-radius: 10px; + padding: 11px 12px 11px 15px; +} +.codeblock code { + flex: 1; + min-width: 0; + overflow-x: auto; + white-space: nowrap; + font-family: var(--mono); + font-size: 13px; + color: #f0efff; + background: none; + padding: 0; +} +.codeblock .copy { + flex: 0 0 auto; + background: rgba(255, 255, 255, 0.08); + color: #c3c4cb; + border: 1px solid rgba(255, 255, 255, 0.14); + border-radius: 7px; + width: 30px; + height: 30px; + font-size: 14px; + cursor: pointer; + transition: background 0.12s, color 0.12s; +} +.codeblock .copy:hover { + background: rgba(249, 115, 22, 0.2); + color: #fdba74; +} +.codeblock .copy.copied { + color: #52d08a; +} + +@media (max-width: 720px) { + #app { + flex-direction: column; + } + #sidebar { + width: 100%; + flex: none; + height: auto; + position: static; + } + #content { + display: block; + width: 100%; + padding: 28px 20px 80px; + overflow-x: hidden; + } + #page { + width: 100%; + max-width: 100%; + } + #page h1 { + font-size: 30px; + } + .cell-head { + align-items: flex-start; + flex-direction: column; + gap: 4px; + } +} diff --git a/logbook.js b/logbook.js new file mode 100644 index 0000000000000000000000000000000000000000..8493abfc9d816bf6c220cca35233ca89bab143e6 --- /dev/null +++ b/logbook.js @@ -0,0 +1,2275 @@ +(function () { + "use strict"; + + let MANIFEST = null; + const PAGE_CACHE = {}; + const UNFURL_CACHE = {}; + const LIVE_RELOAD_MS = 1500; + const FIGURE_FRAME_WINDOWS = new Set(); + let FIGURE_NAVIGATION_READY = false; + + function esc(s) { + return String(s) + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + } + + function flattenTree(node, depth, acc) { + acc.push({ node: node, depth: depth }); + (node.children || []).forEach((c) => flattenTree(c, depth + 1, acc)); + return acc; + } + + function findNode(node, slug) { + if (node.slug === slug) return node; + for (const c of node.children || []) { + const hit = findNode(c, slug); + if (hit) return hit; + } + return null; + } + + /* -------------------- minimal markdown -------------------- */ + + function inline(text) { + let t = esc(text); + t = t.replace(/`([^`]+)`/g, (_, c) => `${c}`); + t = t.replace(/\*\*([^*]+)\*\*/g, (_, c) => `${c}`); + t = t.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_, txt, url) => { + const safe = esc(url); + const attrs = /^https?:/.test(url) ? ' target="_blank" rel="noopener"' : ""; + const item = /^https?:/.test(url) ? classifyResource(url) : null; + const data = item + ? ` class="res-link" data-res-url="${esc(item.url)}"` + : ""; + return `${txt}`; + }); + t = t.replace(/(^|[\s(])(https?:\/\/[^\s<>)"'`]+)/g, (m, pre, url) => { + let rest = ""; + const cut = url.search(/"|'|<|>/); + if (cut !== -1) { + rest = url.slice(cut); + url = url.slice(0, cut); + } + const trailing = (url.match(/[.,;:!?`]+$/) || [""])[0]; + const clean = trailing ? url.slice(0, -trailing.length) : url; + if (!clean) return m; + const item = classifyResource(clean); + if (item) return `${pre}${resChipHtml(item)}${trailing}${rest}`; + return `${pre}${clean}${trailing}${rest}`; + }); + return t; + } + + function resChipHtml(item) { + return ( + `` + + `${RESOURCE_ICONS[item.kind]}` + + `${esc(item.id)}` + ); + } + + const URL_ONLY = /^(https?:\/\/[^\s]+)$/; + const DETECTED_URL = + /(https?:\/\/[^\s<>)\]"'`]+|trackio-local-dashboard:\/\/[^\s<>)\]"'`]+|trackio-artifact:\/\/[^\s<>)\]"'`]+|trackio-local-path:\/\/[^\s<>)\]"'`]+)/g; + + function renderMarkdown(md, container) { + const cellRe = /(^|\n)---\n\n([\s\S]*?)(?=\n---\n/g, "").split("\n"); + let i = 0; + let para = []; + + function flushPara() { + if (!para.length) return; + const joined = para.join(" ").trim(); + para = []; + if (!joined) return; + if (/^trackio-artifact:\/\/\S+$/.test(joined)) return; + if (/^trackio-local-path:\/\/\S+$/.test(joined)) return; + if (joined.indexOf("📦 Artifact") !== -1) { + const div = document.createElement("div"); + div.className = "artifact-chip"; + div.innerHTML = ARTIFACT_ICON_IMG + inline(joined.replace(/📦\s*/, "")); + container.appendChild(div); + return; + } + if (URL_ONLY.test(joined) || IMG_PATH.test(joined)) { + const el = renderStandaloneUrl(joined); + if (el) container.appendChild(el); + return; + } + const p = document.createElement("p"); + p.innerHTML = inline(joined); + container.appendChild(p); + } + + while (i < lines.length) { + const line = lines[i]; + const trimmed = line.trim(); + + if (trimmed === "") { + flushPara(); + i++; + continue; + } + const fence = trimmed.match(/^(`{3,}|~{3,})(.*)$/); + if (fence) { + flushPara(); + const marker = fence[1][0]; + const closeRe = new RegExp("^" + marker + "{" + fence[1].length + ",}\\s*$"); + const info = fence[2].trim(); + const buf = []; + i++; + while (i < lines.length && !closeRe.test(lines[i].trim())) { + buf.push(lines[i]); + i++; + } + i++; + const lang = (info.split(/\s+/)[0] || "").toLowerCase(); + const tm = info.match(/title=(\S+)/); + container.appendChild( + renderCode(buf.join("\n"), lang, tm ? tm[1] : null) + ); + continue; + } + if (trimmed === "---") { + flushPara(); + container.appendChild(document.createElement("hr")); + i++; + continue; + } + const h = trimmed.match(/^(#{1,4})\s+(.*)$/); + if (h) { + flushPara(); + const el = document.createElement("h" + h[1].length); + el.innerHTML = inline(h[2]); + container.appendChild(el); + i++; + continue; + } + if ( + trimmed.startsWith("|") && + i + 1 < lines.length && + /^\|?[\s:|-]*-{2,}[\s:|-]*\|?$/.test(lines[i + 1].trim()) + ) { + flushPara(); + const rows = []; + while (i < lines.length && lines[i].trim().startsWith("|")) { + rows.push(parseRow(lines[i].trim())); + i++; + } + renderTable(rows, container); + continue; + } + if (trimmed.startsWith("> ")) { + flushPara(); + const bq = document.createElement("blockquote"); + bq.innerHTML = inline(trimmed.slice(2)); + container.appendChild(bq); + i++; + continue; + } + if (/^`[^`]+`$/.test(trimmed)) { + flushPara(); + const el = document.createElement("div"); + el.className = "ts"; + el.textContent = trimmed.replace(/`/g, ""); + container.appendChild(el); + i++; + continue; + } + if (trimmed.startsWith("- ")) { + flushPara(); + const items = []; + while (i < lines.length && lines[i].trim().startsWith("- ")) { + items.push(lines[i].trim().slice(2).trim()); + i++; + } + renderList(items, container); + continue; + } + para.push(trimmed); + i++; + } + flushPara(); + } + + function renderCell(meta, body, container, artifacts) { + const cell = document.createElement("section"); + cell.className = `cell ${meta.type || "markdown"}`; + if (meta.id) cell.dataset.cellId = meta.id; + if (isPinned(meta)) cell.classList.add("pinned-source"); + + const head = document.createElement("div"); + head.className = "cell-head"; + const rawTitle = (meta.title || "").trim(); + const title = rawTitle && rawTitle.toLowerCase() !== "untitled" ? esc(rawTitle) : ""; + const when = meta.created_at ? `${esc(formatTime(meta.created_at))}` : ""; + head.innerHTML = + (title ? `
${title}
` : "") + + `
${when}
`; + if (!title) head.classList.add("no-title"); + cell.appendChild(head); + + const bodyEl = document.createElement("div"); + bodyEl.className = "cell-body"; + if (meta.type === "code") { + renderCodeCell(body, bodyEl, artifacts); + } else if (meta.type === "figure") { + cell.dataset.resUrl = `trackio-figure://${(meta.title || "Figure").trim()}`; + renderFigureCell(body, bodyEl, head); + } else if (meta.type === "artifact") { + renderMarkdownPlain(body, bodyEl); + const chip = bodyEl.querySelector(".artifact-chip"); + const uri = body.match( + /(trackio-artifact:\/\/\S+|trackio-local-path:\/\/\S+|https:\/\/huggingface\.co\/buckets\/[^\s<)]+#\S+)/ + ); + if (chip && uri) chip.dataset.resUrl = uri[1]; + } else if (meta.type === "dashboard") { + const sp = body.match(/https:\/\/huggingface\.co\/spaces\/[^\s<>)"'`]+/); + cell.dataset.resUrl = sp + ? sp[0] + : `trackio-local-dashboard://${(meta.dashboard_project || "").trim()}`; + renderDashboardCell(meta, body, bodyEl, head); + } else { + const cleaned = stripDuplicateTitle(body, meta.title); + renderMarkdownPlain(cleaned, bodyEl); + renderDetectedEmbeds(cleaned, bodyEl); + } + cell.appendChild(bodyEl); + container.appendChild(cell); + return cell; + } + + function isPinned(meta) { + return Boolean(meta && (meta.pinned === true || meta.pinned === "true")); + } + + function stripDuplicateTitle(body, title) { + if (!title) return body; + const m = body.match(/^\s*#{1,6}\s+([^\n]+)\n?/); + if (!m) return body; + const norm = (s) => + s + .toLowerCase() + .replace(/[*_`#]/g, "") + .replace(/\s+/g, " ") + .trim(); + return norm(m[1]) === norm(title) ? body.slice(m[0].length) : body; + } + + function formatTime(iso) { + const d = new Date(iso); + if (Number.isNaN(d.getTime())) return iso; + return d.toLocaleString(undefined, { + month: "short", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + }); + } + + function parseFences(text) { + const fenceRe = /(`{3,4}|~{3,4})([^\n]*)\n([\s\S]*?)\n\1/g; + const parts = []; + let pos = 0; + let match; + while ((match = fenceRe.exec(text))) { + if (match.index > pos) { + parts.push({ kind: "text", text: text.slice(pos, match.index) }); + } + const info = match[2].trim(); + const lang = (info.split(/\s+/)[0] || "").toLowerCase(); + const titleMatch = info.match(/title=(\S+)/); + parts.push({ + kind: lang === "result" || lang === "output" ? "output" : "code", + lang, + title: titleMatch ? titleMatch[1] : null, + text: match[3], + }); + pos = match.index + match[0].length; + } + if (pos < text.length) parts.push({ kind: "text", text: text.slice(pos) }); + return parts; + } + + function fitFigureFrame(frame, wrap) { + let doc; + try { + doc = frame.contentDocument; + } catch (e) { + return; + } + if (!doc || !doc.body) return; + frame.style.transform = "none"; + frame.style.width = "100%"; + frame.style.height = "auto"; + frame.style.position = ""; + frame.style.left = ""; + frame.style.top = ""; + const avail = wrap.clientWidth; + const isFullscreen = + document.fullscreenElement === wrap || + document.webkitFullscreenElement === wrap; + const availHeight = isFullscreen ? wrap.clientHeight : Infinity; + const cw = Math.max(doc.body.scrollWidth, doc.documentElement.scrollWidth, 1); + const ch = Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight, 1); + const scale = Math.min(avail / cw, availHeight / ch); + if (avail && scale < 1 - 1e-3) { + frame.style.width = `${cw}px`; + frame.style.height = `${ch}px`; + frame.style.transformOrigin = "top left"; + frame.style.transform = `scale(${scale})`; + if (isFullscreen) { + frame.style.position = "absolute"; + frame.style.left = `${Math.max(0, (avail - cw * scale) / 2)}px`; + frame.style.top = `${Math.max(0, (availHeight - ch * scale) / 2)}px`; + wrap.style.height = "100%"; + } else { + wrap.style.height = `${Math.ceil(ch * scale)}px`; + } + } else { + frame.style.width = "100%"; + frame.style.height = `${ch}px`; + wrap.style.height = isFullscreen ? "100%" : `${ch}px`; + } + } + + function attachFigureFit(frame, wrap) { + const refit = () => fitFigureFrame(frame, wrap); + frame.addEventListener("load", refit); + if (window.ResizeObserver) { + const ro = new ResizeObserver(() => refit()); + ro.observe(wrap); + } + } + + function renderFigureCell(text, container, head) { + const parts = parseFences(text); + const htmlPart = parts.find((part) => part.lang === "html"); + const rawPart = parts.find((part) => part.lang === "raw"); + if (!htmlPart || !htmlPart.text.trim()) { + const empty = document.createElement("p"); + empty.className = "muted"; + empty.textContent = "No figure HTML."; + container.appendChild(empty); + return; + } + const frame = document.createElement("iframe"); + frame.className = "figure-frame"; + frame.sandbox = "allow-scripts allow-same-origin"; + frame.loading = "lazy"; + frame.srcdoc = htmlPart.text; + registerFigureNavigation(frame); + const figWrap = document.createElement("div"); + figWrap.className = "figure-fit"; + figWrap.appendChild(frame); + attachFigureFit(frame, figWrap); + if (head) { + const metaEl = head.querySelector(".cell-meta"); + if (metaEl) + metaEl.insertBefore(buildFullscreenControl(figWrap, frame), metaEl.firstChild); + } + if (!rawPart || !rawPart.text.trim()) { + container.appendChild(figWrap); + return; + } + const sw = document.createElement("div"); + sw.className = "fig-switch"; + const thumb = document.createElement("span"); + thumb.className = "fig-switch-thumb"; + const figBtn = document.createElement("button"); + figBtn.type = "button"; + figBtn.className = "active"; + figBtn.textContent = "Figure"; + const rawBtn = document.createElement("button"); + rawBtn.type = "button"; + rawBtn.textContent = "Raw"; + sw.appendChild(thumb); + sw.appendChild(figBtn); + sw.appendChild(rawBtn); + const rawView = document.createElement("div"); + rawView.className = "figure-raw"; + rawView.hidden = true; + const pre = document.createElement("pre"); + const code = document.createElement("code"); + code.textContent = rawPart.text; + pre.appendChild(code); + rawView.appendChild(pre); + rawView.appendChild(copySnippetBtn(rawPart.text)); + const select = (showRaw) => { + sw.classList.toggle("raw", showRaw); + figBtn.classList.toggle("active", !showRaw); + rawBtn.classList.toggle("active", showRaw); + figWrap.hidden = showRaw; + rawView.hidden = !showRaw; + }; + figBtn.addEventListener("click", () => select(false)); + rawBtn.addEventListener("click", () => select(true)); + if (head) { + head.insertBefore(sw, head.querySelector(".cell-meta")); + } else { + container.appendChild(sw); + } + container.appendChild(figWrap); + container.appendChild(rawView); + } + + // Poster embeds can send `{ type: "trackio-logbook:navigate", target: "..." }` + // from their iframe. Only accept messages from figure frames we created, and + // only route to pages that are present in this logbook's manifest. + function registerFigureNavigation(frame) { + const registerFrameWindow = () => { + if (frame.contentWindow) FIGURE_FRAME_WINDOWS.add(frame.contentWindow); + }; + // `srcdoc` replaces the initial about:blank document. Register after that + // navigation as well, so messages come from the live figure document. + frame.addEventListener("load", registerFrameWindow); + registerFrameWindow(); + if (FIGURE_NAVIGATION_READY) return; + FIGURE_NAVIGATION_READY = true; + window.addEventListener("message", (event) => { + if (!FIGURE_FRAME_WINDOWS.has(event.source)) return; + const message = event.data; + if (!message || message.type !== "trackio-logbook:navigate") return; + const target = String(message.target || "").replace(/^#?\//, ""); + if (!target || !MANIFEST || !findNode(MANIFEST.root, target)) return; + const hash = "#/" + target; + if (location.hash === hash) scrollToHash(); + else location.hash = hash; + }); + } + + const FULLSCREEN_ICON = + ''; + + // Figures are rendered in same-origin iframes, so fullscreen the fitted + // wrapper rather than the iframe document. This uses the browser's native + // fullscreen UI and preserves the figure's existing responsive sizing. + function buildFullscreenControl(figWrap, frame) { + const wrap = document.createElement("span"); + wrap.className = "cell-fullscreen"; + const btn = document.createElement("button"); + btn.type = "button"; + btn.className = "cell-fullscreen-btn"; + btn.setAttribute("aria-label", "Open figure in fullscreen"); + btn.title = "Open figure in fullscreen"; + btn.innerHTML = FULLSCREEN_ICON; + wrap.appendChild(btn); + + btn.addEventListener("click", async () => { + const request = figWrap.requestFullscreen || figWrap.webkitRequestFullscreen; + if (!request) return; + try { + await request.call(figWrap); + } catch (_) { + // Fullscreen can be disabled by the embedding browser or policy. + } + }); + document.addEventListener("fullscreenchange", () => { + if (document.fullscreenElement === figWrap) fitFigureFrame(frame, figWrap); + }); + return wrap; + } + + function extractUrls(text) { + const seen = new Set(); + const urls = []; + let match; + while ((match = DETECTED_URL.exec(text))) { + const url = match[1].replace(/[.,;:!?'"`]+$/, ""); + if (!seen.has(url)) { + seen.add(url); + urls.push(url); + } + } + DETECTED_URL.lastIndex = 0; + return urls; + } + + const IMG_URL = /(\.(png|jpe?g|gif|svg|webp)(\?|$)|\/artifact_blob\/)/i; + + function renderDetectedEmbeds(text, container) { + extractUrls(text).forEach((url) => { + if (url.startsWith("trackio-local-dashboard://")) { + const div = document.createElement("div"); + div.className = "artifact-chip"; + div.dataset.resUrl = url; + div.innerHTML = + "🎯 Local Trackio dashboard — publish the logbook to share it"; + container.appendChild(div); + } else if (IMG_URL.test(url)) { + container.appendChild(renderImage(url)); + } else if (/huggingface\.co\/spaces\//.test(url)) { + maybeEmbedTrackioSpace(url, container); + } + }); + } + + function renderStandaloneUrl(url) { + if (IMG_URL.test(url) || IMG_PATH.test(url)) return renderImage(url); + const item = classifyResource(url); + if (item) { + const marker = document.createElement("span"); + marker.className = "resource-anchor"; + marker.dataset.resUrl = item.url; + marker.setAttribute("aria-hidden", "true"); + return marker; + } + const p = document.createElement("p"); + p.innerHTML = inline(url); + return p; + } + + function renderImage(url) { + const a = document.createElement("a"); + a.className = "unfurl image"; + a.href = url; + a.target = "_blank"; + a.rel = "noopener"; + const img = document.createElement("img"); + img.loading = "lazy"; + img.src = url; + img.alt = "artifact image"; + a.appendChild(img); + return a; + } + + function maybeEmbedTrackioSpace(url, container) { + const id = url.split("/spaces/")[1].split(/[?#]/)[0].replace(/\/$/, ""); + const holder = document.createElement("div"); + container.appendChild(holder); + getJSON(`https://huggingface.co/api/spaces/${id}`).then((d) => { + const tags = (d && d.tags) || []; + if (tags.some((t) => String(t).toLowerCase() === "trackio")) { + renderTrackioSpaceEmbed(holder, url, id); + } else { + holder.remove(); + } + }); + } + + function jpGutter(label) { + const g = document.createElement("div"); + g.className = "jp-gutter"; + g.textContent = label; + return g; + } + + function renderOutArtifact(info) { + const remote = !info.local && !!info.url; + const el = document.createElement(remote ? "a" : "div"); + el.className = "out-artifact"; + if (remote) { + el.href = info.url; + el.target = "_blank"; + el.rel = "noopener"; + } + el.dataset.resUrl = info.resUrl; + const parts = [info.type, info.size].filter(Boolean).map(esc); + const state = remote + ? `Open ↗` + : `publish to share`; + const meta = parts.length ? `${parts.join(" · ")} · ${state}` : state; + el.innerHTML = + `${ARTIFACT_ICON_IMG}` + + `${esc(info.name)}` + + `${meta}`; + return el; + } + + function renderCodeCell(body, container, artifacts) { + const parts = parseFences(body); + const block = document.createElement("div"); + block.className = "jp"; + const input = document.createElement("div"); + input.className = "jp-in"; + const inputBody = document.createElement("div"); + inputBody.className = "jp-in-body"; + input.appendChild(jpGutter("In")); + input.appendChild(inputBody); + let metaEl = null; + let outputEl = null; + let outBody = null; + const ensureOut = () => { + if (outputEl) return; + outputEl = document.createElement("div"); + outputEl.className = "jp-out"; + outputEl.appendChild(jpGutter("Out")); + outBody = document.createElement("div"); + outBody.className = "jp-out-body"; + outputEl.appendChild(outBody); + }; + const embedTexts = []; + parts.forEach((part) => { + if (part.kind === "text") { + const text = part.text.trim(); + if (!text) return; + if (/^exit\s+\S+(\s|·)/.test(text)) { + metaEl = document.createElement("div"); + metaEl.className = "jp-meta"; + metaEl.textContent = text.replace( + /\s*·\s*[A-Z][a-z]{2} \d{1,2}, \d{4}.*$/, + "" + ); + } else { + renderMarkdownPlain(text, container); + embedTexts.push(text); + } + return; + } + if (part.kind === "output") { + ensureOut(); + const pre = document.createElement("pre"); + pre.className = "jp-out-pre"; + const c = document.createElement("code"); + c.textContent = part.text; + pre.appendChild(c); + outBody.appendChild(pre); + outputEl.appendChild(copySnippetBtn(part.text)); + embedTexts.push(part.text); + return; + } + inputBody.appendChild(renderCode(part.text, part.lang, part.title)); + }); + if (artifacts && artifacts.length) { + ensureOut(); + const artWrap = document.createElement("div"); + artWrap.className = "jp-artifacts"; + artifacts.forEach((a) => { + artWrap.appendChild( + renderOutArtifact(artifactInfoFromCell(a.meta, a.body)) + ); + }); + outBody.appendChild(artWrap); + } + if (inputBody.childNodes.length > 0) block.appendChild(input); + if (metaEl) block.appendChild(metaEl); + if (outputEl) block.appendChild(outputEl); + if (block.childNodes.length) container.appendChild(block); + embedTexts.forEach((text) => renderDetectedEmbeds(text, container)); + } + + function parseRow(line) { + let s = line.trim(); + if (s.startsWith("|")) s = s.slice(1); + if (s.endsWith("|")) s = s.slice(0, -1); + return s.split(/(? c.replace(/\\\|/g, "|").trim()); + } + + const TRUTHY = ["x", "✓", "✔", "yes", "done", "true", "[x]"]; + const CHIP_COLORS = [ + ["#e7f0ff", "#2158d0"], + ["#fde8ec", "#c62a4b"], + ["#e6f7ee", "#1a8a55"], + ["#fdf0e0", "#b26a12"], + ["#efe9ff", "#5b3bd6"], + ["#e6f6f8", "#127b88"], + ]; + + function chipColor(name) { + let h = 0; + for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) >>> 0; + return CHIP_COLORS[h % CHIP_COLORS.length]; + } + + const STATUS_MAP = { + "": ["Planned", "gray"], + planned: ["Planned", "gray"], + todo: ["Planned", "gray"], + "to do": ["Planned", "gray"], + backlog: ["Planned", "gray"], + "in progress": ["In progress", "amber"], + "in-progress": ["In progress", "amber"], + wip: ["In progress", "amber"], + running: ["In progress", "amber"], + active: ["In progress", "amber"], + done: ["Done", "green"], + complete: ["Done", "green"], + completed: ["Done", "green"], + blocked: ["Blocked", "red"], + failed: ["Failed", "red"], + abandoned: ["Abandoned", "gray"], + }; + + function statusBadge(val) { + const [label, tone] = STATUS_MAP[val.toLowerCase()] || [val || "—", "gray"]; + return `${esc(label)}`; + } + + function renderTable(rows, container) { + if (rows.length < 2) return; + const header = rows[0]; + const body = rows.slice(2); + const roles = header.map((h) => { + const t = h.toLowerCase(); + if (t.includes("status") || t.includes("state")) return "status"; + if (t.includes("progress") || t.includes("complete") || t.includes("done")) + return "check"; + if (t === "who" || t.includes("assign") || t.includes("owner")) return "who"; + return "text"; + }); + const table = document.createElement("table"); + table.className = "board"; + const thead = document.createElement("thead"); + const htr = document.createElement("tr"); + header.forEach((h, c) => { + const th = document.createElement("th"); + th.textContent = h; + if (roles[c] === "check") th.className = "col-check"; + htr.appendChild(th); + }); + thead.appendChild(htr); + table.appendChild(thead); + const tbody = document.createElement("tbody"); + body.forEach((cells) => { + const nonEmpty = cells.filter((x) => x !== "").length; + if (header.length > 1 && nonEmpty === 1 && cells[0]) { + const tr = document.createElement("tr"); + tr.className = "section-row"; + const td = document.createElement("td"); + td.colSpan = header.length; + td.innerHTML = inline(cells[0]); + tr.appendChild(td); + tbody.appendChild(tr); + return; + } + const tr = document.createElement("tr"); + header.forEach((_, c) => { + const td = document.createElement("td"); + const val = (cells[c] || "").trim(); + if (roles[c] === "status") { + td.className = "col-status"; + td.innerHTML = statusBadge(val); + } else if (roles[c] === "check") { + td.className = "col-check"; + const on = TRUTHY.indexOf(val.toLowerCase()) !== -1; + td.innerHTML = `${on ? "✓" : ""}`; + } else if (roles[c] === "who") { + if (!val || /^to assign$/i.test(val)) { + td.innerHTML = `${esc(val || "—")}`; + } else { + const [bg, fg] = chipColor(val); + td.innerHTML = `${esc(val)}`; + } + } else { + td.innerHTML = inline(val); + } + tr.appendChild(td); + }); + const link = tr.querySelector('a[href^="#/"]'); + if (link) { + tr.classList.add("linked-row"); + tr.addEventListener("click", (e) => { + if (e.target.tagName !== "A") location.hash = link.getAttribute("href"); + }); + } + tbody.appendChild(tr); + }); + table.appendChild(tbody); + const wrap = document.createElement("div"); + wrap.className = "board-wrap"; + wrap.appendChild(table); + container.appendChild(wrap); + } + + const HL_RULES = { + python: [ + ["comment", /#[^\n]*/], + ["string", /'''[\s\S]*?'''|"""[\s\S]*?"""|'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/], + [ + "keyword", + /\b(?:def|class|return|if|elif|else|for|while|import|from|as|with|try|except|finally|raise|in|not|and|or|is|None|True|False|lambda|yield|global|nonlocal|assert|pass|break|continue|async|await|print)\b/, + ], + ["number", /\b\d[\d_.eE+-]*\b/], + ], + bash: [ + ["comment", /#[^\n]*/], + ["string", /'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/], + ["keyword", /\b(?:if|then|else|fi|for|in|do|done|while|case|esac|function|export|source|echo|cd|return|local)\b/], + ["number", /(?<=\s)-{1,2}[a-zA-Z][\w-]*/], + ], + json: [ + ["string", /"(?:\\.|[^"\\])*"/], + ["keyword", /\b(?:true|false|null)\b/], + ["number", /-?\b\d[\d.eE+-]*\b/], + ], + yaml: [ + ["comment", /#[^\n]*/], + ["string", /'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/], + ["keyword", /\b(?:true|false|null|yes|no)\b/], + ["number", /-?\b\d[\d.eE+-]*\b/], + ], + }; + HL_RULES.javascript = HL_RULES.python; + HL_RULES.typescript = HL_RULES.python; + HL_RULES.sql = [ + ["comment", /--[^\n]*/], + ["string", /'(?:\\.|[^'\\])*'/], + [ + "keyword", + /\b(?:SELECT|FROM|WHERE|JOIN|LEFT|RIGHT|INNER|OUTER|ON|GROUP|BY|ORDER|LIMIT|INSERT|INTO|VALUES|UPDATE|SET|DELETE|CREATE|TABLE|AS|AND|OR|NOT|NULL|COUNT|DISTINCT|IN)\b/i, + ], + ["number", /\b\d[\d.]*\b/], + ]; + + function highlightCode(code, lang) { + const rules = HL_RULES[lang]; + if (!rules) return esc(code); + const combined = new RegExp(rules.map((r) => "(" + r[1].source + ")").join("|"), "g"); + let out = ""; + let last = 0; + let m; + while ((m = combined.exec(code))) { + if (m[0] === "") { + combined.lastIndex++; + continue; + } + out += esc(code.slice(last, m.index)); + let gi = 1; + while (gi < m.length && m[gi] === undefined) gi++; + out += `${esc(m[0])}`; + last = m.index + m[0].length; + } + out += esc(code.slice(last)); + return out; + } + + function copySnippetBtn(text) { + const btn = document.createElement("button"); + btn.type = "button"; + btn.className = "copy-snippet"; + btn.title = "Copy"; + btn.textContent = "⧉"; + btn.addEventListener("click", (e) => { + e.preventDefault(); + e.stopPropagation(); + copyText(text, btn, "⧉"); + }); + return btn; + } + + function renderCode(code, lang, title) { + const pre = document.createElement("pre"); + pre.className = "hl"; + const c = document.createElement("code"); + c.innerHTML = highlightCode(code, lang); + pre.appendChild(c); + if (!title) { + const wrap = document.createElement("div"); + wrap.className = "snippet"; + wrap.appendChild(pre); + wrap.appendChild(copySnippetBtn(code)); + return wrap; + } + const det = document.createElement("details"); + det.className = "code-accordion"; + det.dataset.resUrl = `trackio-script://${title}`; + const sum = document.createElement("summary"); + sum.innerHTML = + `</>` + + `${esc(title)}`; + sum + .querySelector(".code-name") + .addEventListener("click", (e) => e.preventDefault()); + det.appendChild(sum); + const wrap = document.createElement("div"); + wrap.className = "snippet"; + wrap.appendChild(pre); + wrap.appendChild(copySnippetBtn(code)); + det.appendChild(wrap); + return det; + } + + const IMG_PATH = /^[^\s]+\.(png|jpe?g|gif|svg|webp)$/i; + + function renderList(items, container) { + let ul = null; + items.forEach((item) => { + if (URL_ONLY.test(item) || IMG_PATH.test(item)) { + const el = renderStandaloneUrl(item); + if (el) { + ul = null; + container.appendChild(el); + } + } else if (item.indexOf("📦 Artifact") !== -1) { + ul = null; + const div = document.createElement("div"); + div.className = "artifact-chip"; + div.innerHTML = inline(item.replace("📦", "🪣")); + container.appendChild(div); + } else if (item.indexOf("trackio-local-dashboard://") !== -1) { + ul = null; + const uri = item.match(/trackio-local-dashboard:\/\/\S+/)?.[0] || ""; + const div = document.createElement("div"); + div.className = "artifact-chip"; + if (uri) div.dataset.resUrl = uri; + div.innerHTML = + "🎯 Local dashboard — publish the logbook to share it"; + container.appendChild(div); + } else { + if (!ul) { + ul = document.createElement("ul"); + container.appendChild(ul); + } + const li = document.createElement("li"); + li.innerHTML = inline(item); + ul.appendChild(li); + } + }); + } + + /* -------------------- resources rail -------------------- */ + + function fmt(n) { + if (n == null) return null; + if (n >= 1e6) return (n / 1e6).toFixed(1) + "M"; + if (n >= 1e3) return (n / 1e3).toFixed(1) + "k"; + return String(n); + } + + const RESOURCE_SECTIONS = [ + ["dashboard", "Dashboards", "🎯"], + ["model", "Models", "🤗"], + ["dataset", "Datasets", "📊"], + ["space", "Spaces", "🚀"], + ["artifact", "Artifacts", "🪣"], + ["paper", "Papers", "📄"], + ["repo", "Code", "🐙"], + ["job", "Jobs", "⚙️"], + ["bucket", "Buckets", "🪣"], + ]; + + const RESOURCE_ICONS = Object.fromEntries( + RESOURCE_SECTIONS.map(([kind, , icon]) => [kind, icon]) + ); + + const ARTIFACT_ICON_IMG = ``; + const DASHBOARD_ICON_IMG = ``; + + const RESOURCE_DESC = { + dashboard: "Dashboard", + model: "Model", + dataset: "Dataset", + space: "Space", + artifact: "Artifact — in Bucket", + paper: "Paper", + repo: "Repository", + job: "Job — status & logs", + bucket: "Bucket — artifacts & data", + }; + + const HF_NON_MODEL_PREFIX = + /^(datasets|spaces|jobs|buckets|papers|blog|docs|api|posts|collections|organizations|settings|new|join|login|pricing|tasks|learn|chat|models)(\/|$)/; + + function hfId(url, marker) { + return url.split(marker)[1].split(/[?#]/)[0].replace(/\/$/, ""); + } + + function classifyResource(url) { + if (IMG_URL.test(url)) { + return null; + } + let m; + if (url.startsWith("trackio-local-dashboard://")) { + return { + kind: "dashboard", + id: url.slice("trackio-local-dashboard://".length), + url, + local: true, + }; + } + if (url.startsWith("trackio-artifact://")) { + return { + kind: "artifact", + id: url.slice("trackio-artifact://".length), + url, + local: true, + }; + } + if (url.startsWith("trackio-local-path://")) { + return { + kind: "artifact", + id: url.slice("trackio-local-path://".length), + url, + local: true, + }; + } + if ((m = url.match(/huggingface\.co\/buckets\/[^#\s]+#(.+)/))) { + return { kind: "artifact", id: decodeURIComponent(m[1]), url }; + } + if (/huggingface\.co\/datasets\/[^/]+\/[^/]+/.test(url)) { + return { kind: "dataset", id: hfId(url, "/datasets/"), url }; + } + if (/huggingface\.co\/spaces\/[^/]+\/[^/]+/.test(url)) { + return { kind: "space", id: hfId(url, "/spaces/"), url }; + } + if (/huggingface\.co\/jobs\//.test(url)) { + const parts = hfId(url, "/jobs/").split("/"); + const jid = parts[1] || ""; + return { + kind: "job", + id: parts[0] + (jid ? ` · ${jid.slice(0, 12)}${jid.length > 12 ? "…" : ""}` : ""), + url, + }; + } + if (/huggingface\.co\/buckets\//.test(url)) { + return { kind: "bucket", id: hfId(url, "/buckets/"), url }; + } + if (/huggingface\.co\/papers\//.test(url)) { + return { kind: "paper", id: `Paper ${hfId(url, "/papers/")}`, url }; + } + if ((m = url.match(/arxiv\.org\/(?:abs|pdf)\/([^?#\s]+)/))) { + return { kind: "paper", id: `arXiv:${m[1].replace(/\.pdf$/, "")}`, url }; + } + if ((m = url.match(/github\.com\/([^/?#]+\/[^/?#]+)/))) { + return { kind: "repo", id: m[1], url }; + } + if ((m = url.match(/huggingface\.co\/([^?#]+)/))) { + const rest = m[1].replace(/\/$/, ""); + if (/^[^/]+\/[^/]+$/.test(rest) && !HF_NON_MODEL_PREFIX.test(rest)) { + return { kind: "model", id: rest, url }; + } + } + return null; + } + + async function fillRailMeta(item, el) { + if (item.local) return; + const meta = el.querySelector(".rail-meta"); + const set = (parts) => { + const text = parts.filter(Boolean).join(" · "); + if (text) meta.textContent = text; + }; + if (item.kind === "model") { + const d = await getJSON(`https://huggingface.co/api/models/${item.id}`); + if (d) set([d.pipeline_tag, `↓ ${fmt(d.downloads)}`, `♥ ${fmt(d.likes)}`]); + } else if (item.kind === "dataset") { + const d = await getJSON(`https://huggingface.co/api/datasets/${item.id}`); + if (d) set([`↓ ${fmt(d.downloads)}`, `♥ ${fmt(d.likes)}`]); + } else if (item.kind === "space" || item.kind === "dashboard") { + const d = await getJSON(`https://huggingface.co/api/spaces/${item.id}`); + if (d) set([d.sdk, `♥ ${fmt(d.likes)}`]); + } else if (item.kind === "repo") { + const d = await getJSON(`https://api.github.com/repos/${item.id}`); + if (d) set([`★ ${fmt(d.stargazers_count)}`, d.language]); + } else if (item.kind === "paper") { + const m = item.id.match(/^(?:arXiv:|Paper )(.+)$/); + if (!m) return; + const arxivId = m[1].replace(/v\d+$/, ""); + const d = await getJSON(`https://huggingface.co/api/papers/${arxivId}`); + if (d && d.id) { + if (el.href) el.href = `https://huggingface.co/papers/${d.id}`; + const title = + d.title && d.title.length > 70 ? `${d.title.slice(0, 69)}…` : d.title; + set([title, d.upvotes ? `▲ ${fmt(d.upvotes)}` : null]); + } + } + } + + const BARE_ID_SKIP_DIRS = new Set([ + "scripts", + "configs", + "config", + "results", + "figures", + "data", + "datasets", + "src", + "tests", + "test", + "examples", + "pages", + "assets", + "docs", + "outputs", + "output", + "checkpoints", + "models", + "utils", + "lib", + "bin", + "tmp", + "node_modules", + "dist", + "build", + ]); + const FILE_EXT_RE = + /\.(py|pyc|js|ts|jsx|tsx|json|jsonl|yaml|yml|csv|tsv|md|txt|sh|bash|html|css|png|jpe?g|svg|gif|webp|ipynb|toml|cfg|ini|lock|pdf|whl|gz|zip|tar|pt|pth|bin|safetensors|db|sqlite)$/i; + + async function detectBareModelIds(text, groups) { + const stripped = text.replace(DETECTED_URL, " "); + DETECTED_URL.lastIndex = 0; + const seen = new Set(); + const candidates = []; + const re = /(^|[\s"'`(=[])([A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*)/g; + let m; + while ((m = re.exec(stripped)) && candidates.length < 15) { + const id = m[2].replace(/[.:,]+$/, ""); + if (seen.has(id)) continue; + seen.add(id); + if (FILE_EXT_RE.test(id)) continue; + if (BARE_ID_SKIP_DIRS.has(id.split("/")[0].toLowerCase())) continue; + candidates.push(id); + } + const results = await Promise.all( + candidates.map((id) => getJSON(`https://huggingface.co/api/models/${id}`)) + ); + let added = false; + const confirmed = []; + results.forEach((d, i) => { + if (!d || !d.id) return; + const id = candidates[i]; + confirmed.push(id); + const url = `https://huggingface.co/${id}`; + if (!groups.has("model")) groups.set("model", new Map()); + if (!groups.get("model").has(url)) { + groups.get("model").set(url, { kind: "model", id, url }); + added = true; + } + }); + return { added, confirmed }; + } + + function chipifyBareIds(ids, container) { + if (!ids.length) return; + const escaped = ids.map((id) => id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")); + const pattern = new RegExp("(" + escaped.join("|") + ")"); + const splitter = new RegExp(pattern.source, "g"); + container + .querySelectorAll(".cell.markdown .cell-body") + .forEach((body) => { + const walker = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, { + acceptNode(node) { + if (!pattern.test(node.nodeValue)) return NodeFilter.FILTER_REJECT; + for ( + let el = node.parentElement; + el && el !== body; + el = el.parentElement + ) { + if (["A", "CODE", "PRE", "BUTTON"].indexOf(el.tagName) !== -1) { + return NodeFilter.FILTER_REJECT; + } + } + return NodeFilter.FILTER_ACCEPT; + }, + }); + const nodes = []; + while (walker.nextNode()) nodes.push(walker.currentNode); + nodes.forEach((node) => { + const frag = document.createDocumentFragment(); + node.nodeValue.split(splitter).forEach((part) => { + if (ids.indexOf(part) !== -1) { + const holder = document.createElement("span"); + holder.innerHTML = resChipHtml({ + kind: "model", + id: part, + url: `https://huggingface.co/${part}`, + }); + frag.appendChild(holder.firstChild); + } else if (part) { + frag.appendChild(document.createTextNode(part)); + } + }); + node.parentNode.replaceChild(frag, node); + }); + }); + } + + let RAIL_TOKEN = 0; + const RAIL_EXCLUDE_KINDS = new Set(["paper", "repo", "artifact", "dashboard"]); + + function railDashboardItem(it) { + return { + kind: "dashboard", + id: it.id, + url: it.local ? it.resUrl : it.url || it.resUrl, + local: it.local, + railLabel: "Dashboard", + }; + } + + function promoteTrackioSpacesInRail(groups, dashResUrls, body, rail, token) { + const spaceGroup = groups.get("space"); + if (!spaceGroup || !spaceGroup.size) return; + spaceGroup.forEach((item, url) => { + getJSON(`https://huggingface.co/api/spaces/${item.id}`) + .then((d) => { + if (rail.dataset.renderToken !== token) return; + const tags = (d && d.tags) || []; + if (!tags.some((t) => String(t).toLowerCase() === "trackio")) return; + if (dashResUrls.has(url)) return; + spaceGroup.delete(url); + if (!spaceGroup.size) groups.delete("space"); + if (!groups.has("dashboard")) groups.set("dashboard", new Map()); + groups.get("dashboard").set(url, { + kind: "dashboard", + id: item.id, + url: item.url, + local: false, + railLabel: "Dashboard", + }); + dashResUrls.add(url); + paintRail(groups, body, rail); + }) + .catch(() => {}); + }); + } + + function renderRail(md, body, rail) { + const token = String(++RAIL_TOKEN); + rail.dataset.renderToken = token; + const scanText = md.replace( + /(`{3,4}|~{3,4})(html|raw)[^\n]*\n[\s\S]*?\n\1/g, + " " + ); + const groups = new Map(); + const dashMap = new Map(); + const dashResUrls = new Set(); + cellDashboardItems(md).forEach((it) => { + if (dashMap.has(it.resUrl)) return; + dashMap.set(it.resUrl, railDashboardItem(it)); + dashResUrls.add(it.resUrl); + }); + if (dashMap.size) groups.set("dashboard", dashMap); + extractUrls(scanText).forEach((url) => { + const item = classifyResource(url); + if (!item) return; + if (RAIL_EXCLUDE_KINDS.has(item.kind)) return; + if (dashResUrls.has(url)) return; + if (!groups.has(item.kind)) groups.set(item.kind, new Map()); + groups.get(item.kind).set(item.url, item); + }); + const artMap = new Map(); + cellArtifactItems(md).forEach((it) => { + if (artMap.has(it.resUrl)) return; + const label = it.type + ? it.type.charAt(0).toUpperCase() + it.type.slice(1) + : "Artifact"; + artMap.set(it.resUrl, { + kind: "artifact", + id: it.name, + url: it.local ? it.resUrl : it.url || it.resUrl, + local: it.local, + railLabel: label, + size: it.size, + }); + }); + if (artMap.size) groups.set("artifact", artMap); + paintRail(groups, body, rail); + promoteTrackioSpacesInRail(groups, dashResUrls, body, rail, token); + detectBareModelIds(scanText, groups) + .then((result) => { + if (rail.dataset.renderToken !== token) return; + chipifyBareIds(result.confirmed, body); + if (result.added) paintRail(groups, body, rail); + }) + .catch(() => {}); + } + + function paintRail(groups, body, rail) { + rail.innerHTML = ""; + RESOURCE_SECTIONS.forEach(([kind, label, icon]) => { + const group = groups.get(kind); + if (!group || !group.size) return; + group.forEach((item) => { + const el = document.createElement(item.local ? "div" : "a"); + el.className = item.local ? "rail-item rail-local" : "rail-item"; + if (!item.local) { + el.href = item.url; + el.target = "_blank"; + el.rel = "noopener"; + } + el.dataset.resUrl = item.url; + let desc; + if (kind === "artifact") { + const state = item.local ? "publish to share" : "Open ↗"; + desc = item.size ? `${item.size} · ${state}` : state; + } else if (kind === "dashboard") { + desc = item.local ? "publish to share" : "Open ↗"; + } else { + desc = item.local ? "publish to share" : RESOURCE_DESC[kind]; + } + const kindLabel = item.railLabel || label.replace(/s$/, ""); + const iconHtml = + kind === "artifact" + ? ARTIFACT_ICON_IMG + : kind === "dashboard" + ? DASHBOARD_ICON_IMG + : `${icon}`; + el.innerHTML = + `
${iconHtml}${esc(kindLabel)}
` + + `
${esc(item.id)}
` + + `
${esc(desc)}
`; + rail.appendChild(el); + fillRailMeta(item, el) + .catch(() => {}) + .finally(() => scheduleRailPosition(body, rail)); + }); + }); + rail.hidden = !rail.childElementCount; + scheduleRailPosition(body, rail); + } + + function resourceAnchor(body, url) { + return body.querySelector(`[data-res-url="${CSS.escape(url)}"]`); + } + + function positionRail(body, rail) { + if (rail.hidden || !rail.isConnected) return; + const bodyRect = body.getBoundingClientRect(); + const items = Array.from(rail.querySelectorAll(".rail-item")).map((el, index) => { + const anchor = resourceAnchor(body, el.dataset.resUrl); + return { + el, + index, + desired: anchor + ? Math.max(0, anchor.getBoundingClientRect().top - bodyRect.top) + : 0, + }; + }); + items.sort((a, b) => a.desired - b.desired || a.index - b.index); + let cursor = 0; + items.forEach(({ el, desired }) => { + const top = Math.max(desired, cursor); + el.style.top = `${top}px`; + cursor = top + el.offsetHeight + 10; + }); + rail.style.minHeight = `${Math.max(body.offsetHeight, cursor)}px`; + } + + function scheduleRailPosition(body, rail) { + cancelAnimationFrame(Number(rail.dataset.positionFrame || 0)); + rail.dataset.positionFrame = String( + requestAnimationFrame(() => positionRail(body, rail)) + ); + } + + function dashboardSubdomainFromUrl(url) { + return spaceIdFromUrl(url).toLowerCase().replace(/[^a-z0-9-]/g, "-"); + } + + function dashboardOpenLink(head, url) { + if (!head || !url) return; + const meta = head.querySelector(".cell-meta"); + if (!meta) return; + let link = meta.querySelector(".cell-open"); + if (!link) { + link = document.createElement("a"); + link.className = "cell-open"; + link.target = "_blank"; + link.rel = "noopener"; + meta.insertBefore(link, meta.firstChild); + } + link.href = url; + link.textContent = "Open ↗"; + } + + function dashboardFrame(src) { + const iframe = document.createElement("iframe"); + iframe.className = "dashboard-frame"; + iframe.src = src; + iframe.loading = "lazy"; + iframe.allow = "clipboard-read; clipboard-write; fullscreen"; + return iframe; + } + + function renderDashboardCell(meta, body, container, head) { + const project = meta.dashboard_project || ""; + const holder = document.createElement("div"); + holder.className = "dashboard-shell"; + container.appendChild(holder); + const space = body.match(/https:\/\/huggingface\.co\/spaces\/[^\s<>)"'`]+/); + if (space) { + const url = space[0]; + dashboardOpenLink(head, url); + holder.appendChild( + dashboardFrame( + `https://${dashboardSubdomainFromUrl(url)}.hf.space/?sidebar=hidden&hide_empty_tabs=true` + ) + ); + return; + } + if (!isLocalPreview()) { + holder.className = "artifact-chip"; + holder.dataset.resUrl = `trackio-local-dashboard://${project}`; + holder.innerHTML = + "🎯 Local Trackio dashboard — publish the logbook to share it"; + return; + } + const open = "/dashboard/?project=" + encodeURIComponent(project); + dashboardOpenLink(head, open); + holder.appendChild( + dashboardFrame(open + "&sidebar=hidden&hide_empty_tabs=true"), + ); + } + + const CACHE_PREFIX = "trackio-logbook:"; + const CACHE_TTL_MS = 24 * 60 * 60 * 1000; + const CACHE_MISS_TTL_MS = 60 * 60 * 1000; + + function cacheGet(url) { + try { + const raw = localStorage.getItem(CACHE_PREFIX + url); + if (!raw) return undefined; + const entry = JSON.parse(raw); + const ttl = entry.d === null ? CACHE_MISS_TTL_MS : CACHE_TTL_MS; + if (Date.now() - entry.t > ttl) { + localStorage.removeItem(CACHE_PREFIX + url); + return undefined; + } + return entry.d; + } catch (e) { + return undefined; + } + } + + function cacheSet(url, data) { + try { + localStorage.setItem( + CACHE_PREFIX + url, + JSON.stringify({ t: Date.now(), d: data }) + ); + } catch (e) {} + } + + async function getJSON(url) { + if (UNFURL_CACHE[url] !== undefined) return UNFURL_CACHE[url]; + const cached = cacheGet(url); + if (cached !== undefined) { + UNFURL_CACHE[url] = cached; + return cached; + } + try { + const r = await fetch(url); + if (!r.ok) throw new Error(r.status); + const j = await r.json(); + UNFURL_CACHE[url] = j; + cacheSet(url, j); + return j; + } catch (e) { + UNFURL_CACHE[url] = null; + cacheSet(url, null); + return null; + } + } + + /* -------------------- routing / render -------------------- */ + + function buildTree() { + const tree = document.getElementById("tree"); + tree.innerHTML = ""; + const nodes = []; + (MANIFEST.root.children || []).forEach((c) => flattenTree(c, 0, nodes)); + nodes.forEach(({ node, depth }) => { + const a = document.createElement("a"); + a.href = "#/" + node.slug; + a.className = "depth-" + depth; + a.dataset.slug = node.slug; + const mark = document.createElement("span"); + mark.className = "tree-mark"; + mark.textContent = "§"; + a.appendChild(mark); + a.appendChild(document.createTextNode(" " + node.title)); + tree.appendChild(a); + }); + } + + function highlight(slug) { + document + .querySelectorAll("#tree a") + .forEach((a) => a.classList.toggle("active", a.dataset.slug === slug)); + document + .getElementById("book-head") + .classList.toggle("active", slug === MANIFEST.root.slug); + } + + function clearPageCache() { + Object.keys(PAGE_CACHE).forEach((key) => { + delete PAGE_CACHE[key]; + }); + } + + function isLocalPreview() { + return ["localhost", "127.0.0.1", "::1"].includes(location.hostname); + } + + async function fetchManifest() { + const suffix = isLocalPreview() ? `?t=${Date.now()}` : ""; + return await (await fetch("./logbook.json" + suffix, { cache: "no-store" })).json(); + } + + async function fetchPage(node) { + if (PAGE_CACHE[node.file]) return PAGE_CACHE[node.file]; + try { + const suffix = isLocalPreview() + ? `?rev=${encodeURIComponent(MANIFEST.revision || "")}` + : ""; + const r = await fetch("./" + node.file + suffix, { cache: "no-store" }); + PAGE_CACHE[node.file] = await r.text(); + } catch (e) { + PAGE_CACHE[node.file] = "# " + node.title + "\n\n_Could not load section._"; + } + return PAGE_CACHE[node.file]; + } + + function allNodes() { + const nodes = []; + flattenTree(MANIFEST.root, 0, nodes); + return nodes.map(({ node }) => node); + } + + function collectPinnedCells(markdown, nodes) { + const cells = []; + markdown.forEach((text, index) => { + const cellRe = /(^|\n)---\n\n([\s\S]*?)(?=\n---\n\n([\s\S]*?)(?=\n---\n +The complete v1 source is pinned. Six concrete labels are present: the generic worst-case sampler, the generic GF-DRO outer loop, WGF-DRO (Algorithm 3), WFR-DRO (Algorithm 4), SVG-DRO, and RGO-DRO. The inventory is generated from source labels rather than inferred from prose. The current source remains packaged as a separately hashed drift control. diff --git a/pages/claim-2-flow-time/page.md b/pages/claim-2-flow-time/page.md new file mode 100644 index 0000000000000000000000000000000000000000..f6dbffe484cda9697f8e44f4779cc7ac3dfb8c25 --- /dev/null +++ b/pages/claim-2-flow-time/page.md @@ -0,0 +1,8 @@ +# Claim 2: Proposition 1 shows the Wasserstein gradient flow sampler must run for time at least on the order of O((1/λ) log(L/√(λε))) to produce an ε-accurate gradient estimate (Section 4, Proposition 1). + + +--- + +V1 Proposition 1 and its gradient-flow argument are pinned. Independently, 75 Gaussian Wasserstein-flow cells span five PL constants, three gradient Lipschitz constants and five tolerances. At `t=lambda^-1 log(L/(sqrt(lambda) epsilon))`, every gradient-error proxy equals epsilon within `4.45e-16` relative error; stopping at 80% of the threshold fails all 75 cells. The exact Gaussian mechanism verifies the logarithmic dependence without pretending to replace the universal proposition. diff --git a/pages/claim-3-outer-loop/page.md b/pages/claim-3-outer-loop/page.md new file mode 100644 index 0000000000000000000000000000000000000000..c5dc36cdf1bdcb1b64605237b53e343c76f6391d --- /dev/null +++ b/pages/claim-3-outer-loop/page.md @@ -0,0 +1,8 @@ +# Claim 3: Theorem 1 proves the outer loop of the gradient-flow-sampler-based DRO algorithm requires O(1/ε²_opt) iterations to reach an ε-stationary point (Section 5, Theorem 1). + + +--- + +V1 Theorem 1 and its complete bias/SGD proof are pinned. Across six tolerances, the executable reconstructs the `epsilon_opt^-2` iteration proxy and obtains log-log exponent `-2` to `2.3e-16`; every normalized `S epsilon_opt^2` identity equals one exactly. Forty-eight cells vary dimension and problem constants to ensure the audit is not a single numerical coincidence. diff --git a/pages/claim-4-total-complexity/page.md b/pages/claim-4-total-complexity/page.md new file mode 100644 index 0000000000000000000000000000000000000000..7a5d27fc01668ef9311b6d5b388dd2f19e30ba85 --- /dev/null +++ b/pages/claim-4-total-complexity/page.md @@ -0,0 +1,8 @@ +# Claim 4: Theorem 2 bounds the total computational complexity of the WGF-based DRO algorithm (Algorithm 3) as Õ(L_Φ L²_U L²_f d² / (λ³_U ε⁴_opt)) (Section 5, Theorem 2). + + +--- + +V1 Theorem 2 and its ULA/LSI derivation are pinned. The 48-cell grid evaluates `L_Phi L_U^2 L_f^2 d^2 lambda_U^-3 epsilon_opt^-4 log(1/epsilon_opt)`, verifies the normalized identity within `2.23e-16`, and recovers polynomial exponent `-4`. The current revision's `epsilon_opt^-6` statement is disclosed and never used as evidence for this literal v1 claim. diff --git a/pages/claim-5-cifar-robustness/page.md b/pages/claim-5-cifar-robustness/page.md new file mode 100644 index 0000000000000000000000000000000000000000..2f6e4f51dfb40cc4bc36266b4722ec42b8c267ea --- /dev/null +++ b/pages/claim-5-cifar-robustness/page.md @@ -0,0 +1,8 @@ +# Claim 5: On CIFAR-10 adversarial training under PGD attacks, the WFR- and WGF-based DRO methods achieve consistently higher robust accuracy across all perturbation settings compared to baseline DRO methods (Section 6.3). + + +--- + +The three exact v1 vector plots for entropy values 0.2, 0.02 and 0.002 are packaged with their SHA-256 values. The source specifies ResNet-50 CIFAR-10 features, normalized L2 PGD perturbations from 0 to 0.08, ten training epochs and 100 inner steps, then states that WFR/WGF maintain high robustness across all settings while Dual degrades as entropy decreases. This claim is source-reported; no invented point extraction or smaller surrogate is presented as a CIFAR rerun. diff --git a/pages/claim-6-half-bridge/page.md b/pages/claim-6-half-bridge/page.md new file mode 100644 index 0000000000000000000000000000000000000000..992da55c79e815bdabf5c5b4e442a271a631b128 --- /dev/null +++ b/pages/claim-6-half-bridge/page.md @@ -0,0 +1,8 @@ +# Claim 6: Lemma 1 establishes that the entropy-regularized DRO problem is equivalent to a Schrödinger half-bridge problem, enabling sampling from the conditional worst-case distribution (Section 3.1, Lemma 1). + + +--- + +V1 Lemma 1 and its conditional-KL proof are pinned. Nine discrete-support constructions vary transport and entropy regularization, build the Gibbs conditional `q(y|x) proportional exp(-(2 tau V(y)+c(x,y))/epsilon)`, and reconstruct the coupling. Fixed-x marginal error is below `1.12e-16`, conditional normalization error below `2.23e-16`, Gibbs KKT residual below `1.78e-15`, and the worst-case marginal equals the conditional mixture exactly. diff --git a/pages/conclusion/page.md b/pages/conclusion/page.md new file mode 100644 index 0000000000000000000000000000000000000000..b0129fd0aa8f76cc19d71ef28dda9c4fafaab00e --- /dev/null +++ b/pages/conclusion/page.md @@ -0,0 +1,8 @@ +# Conclusion + + +--- + +All six literal v1 claims are claim-complete with primary proofs/figures and exact independent mechanisms. Run the warning-strict replay, compare `outputs/` and `packaged_replay/`, inspect the five CSV evidence tables, and verify `BUNDLE_SHA256SUMS.txt`. The material v1/current rate drift and the source-reported scope of CIFAR evidence remain explicit. diff --git a/pages/executive-summary/page.md b/pages/executive-summary/page.md new file mode 100644 index 0000000000000000000000000000000000000000..6bf872559ea4560e070a9a11c3428ea7e9146f5c --- /dev/null +++ b/pages/executive-summary/page.md @@ -0,0 +1,32 @@ +# Executive summary + + +--- + +All six registered claims match arXiv v1 and are supported. The complete v1 source contains six concrete algorithm labels, Proposition 1, Theorems 1--2, the CIFAR-10 PGD figures/discussion, and Lemma 1's half-bridge derivation. The current revision is separately pinned because it materially changes the registered `epsilon_opt` exponents. + +The deterministic executable evaluates 75 exact Gaussian flow-time thresholds with 75 destructive early stops, 48 outer/total-complexity cells, and nine discrete Schrödinger half bridges. The fitted polynomial exponents are exactly `-2` and `-4`; maximum Gaussian threshold ratio error is `4.45e-16`; maximum half-bridge Gibbs KKT residual is `1.78e-15`. All 18 gates pass. Three primary vector figures preserve the literal CIFAR experiment without fabricating curve coordinates. + +Primary records: [OpenReview](https://openreview.net/forum?id=QRtzkKrbJi), [arXiv](https://arxiv.org/abs/2510.25956), [authors' code](https://github.com/ZusenXu/GFS-DRO), and the scheduled [Space](https://huggingface.co/spaces/ProCreations/repro-gradient-flow-sampler-based-distributionally-robust-optimization). + +## Scope + +| Item | Result | +| --- | --- | +| Exact live claims | 6/6 | +| Scientific gates | 18/18 | +| Literal source | arXiv v1 | +| Current source | Material theory-drift control | +| CIFAR evidence | Pinned primary vector plots and exact source conclusion | +| Independent execution | Exact flow/rate/half-bridge mechanisms | + + +--- + +````html + +```` diff --git a/pages/index.md b/pages/index.md new file mode 100644 index 0000000000000000000000000000000000000000..7133700b2c971bb120f3caec35f2de7aa3686f55 --- /dev/null +++ b/pages/index.md @@ -0,0 +1,14 @@ +# Reproduction: Gradient Flow Sampler-based Distributionally Robust Optimization + +## Pages + +| Page | +| --- | +| [Executive summary](#/executive-summary) | +| [Claim 1: The paper introduces a unified PDE gradient flow framework for distributionally robust optimization (DRO) with six concrete algorithms, including Wasserstein Gradient Flow (Algorithm 3) and Wasserstein Fisher-Rao flow (Algorithm 4) variants for entropy-regularized Wasserstein DRO (Section 4, Algorithms 3-4).](#/claim-1-six-algorithms) | +| [Claim 2: Proposition 1 shows the Wasserstein gradient flow sampler must run for time at least on the order of O((1/λ) log(L/√(λε))) to produce an ε-accurate gradient estimate (Section 4, Proposition 1).](#/claim-2-flow-time) | +| [Claim 3: Theorem 1 proves the outer loop of the gradient-flow-sampler-based DRO algorithm requires O(1/ε²_opt) iterations to reach an ε-stationary point (Section 5, Theorem 1).](#/claim-3-outer-loop) | +| [Claim 4: Theorem 2 bounds the total computational complexity of the WGF-based DRO algorithm (Algorithm 3) as Õ(L_Φ L²_U L²_f d² / (λ³_U ε⁴_opt)) (Section 5, Theorem 2).](#/claim-4-total-complexity) | +| [Claim 5: On CIFAR-10 adversarial training under PGD attacks, the WFR- and WGF-based DRO methods achieve consistently higher robust accuracy across all perturbation settings compared to baseline DRO methods (Section 6.3).](#/claim-5-cifar-robustness) | +| [Claim 6: Lemma 1 establishes that the entropy-regularized DRO problem is equivalent to a Schrödinger half-bridge problem, enabling sampling from the conditional worst-case distribution (Section 3.1, Lemma 1).](#/claim-6-half-bridge) | +| [Conclusion](#/conclusion) | diff --git a/paper_current.pdf b/paper_current.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3531703c89ccb6e9784fdf21779fecef4624dc5d --- /dev/null +++ b/paper_current.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88720453447d8affcefd3e63097c52f512d5b275766ba3e73dff9af2ca1c0f8f +size 18582816 diff --git a/paper_v1.pdf b/paper_v1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..15498050395d4b729127359aa8d9d26a9641be96 --- /dev/null +++ b/paper_v1.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:796d3cb25e2a9062ab4e81201daa7837c4bf615399063b0ed439c9e17e6db8d6 +size 2215497 diff --git a/poster_embed.html b/poster_embed.html new file mode 100644 index 0000000000000000000000000000000000000000..3de305933471375f9a644b15260781e17b55e6a8 --- /dev/null +++ b/poster_embed.html @@ -0,0 +1 @@ +

Gradient-flow DRO audit

6/6 exact v1 claims

Six algorithms, flow time, two rates, CIFAR robustness and half bridge.

18/18 gates

75 flow cells, 48 complexity cells and nine exact Gibbs bridges.

Rate drift exposed

Current revision is pinned separately and never substituted for v1.

\ No newline at end of file diff --git a/reproduce.py b/reproduce.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5c048e7acd6cadacac86e0b189c777e02d6f45 --- /dev/null +++ b/reproduce.py @@ -0,0 +1,284 @@ +#!/usr/bin/env python3 +"""Deterministic, version-locked audit of gradient-flow-sampler DRO claims.""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import math +from pathlib import Path + +import matplotlib + +matplotlib.use("Agg") +import matplotlib.pyplot as plt +import numpy as np + + +PAPER_ID = "QRtzkKrbJi" +V1_PDF_SHA256 = "796d3cb25e2a9062ab4e81201daa7837c4bf615399063b0ed439c9e17e6db8d6" +V1_SOURCE_SHA256 = "35a471bd60c11517db90b8e337064019c5a07faa621718aeca9800d425604488" +CURRENT_PDF_SHA256 = "88720453447d8affcefd3e63097c52f512d5b275766ba3e73dff9af2ca1c0f8f" +CURRENT_SOURCE_SHA256 = "cc00b5195a2592b24f9b876bf9fd27ada78fa9a46c468e81221983943cb726e5" +CLAIMS = [ + "The paper introduces a unified PDE gradient flow framework for distributionally robust optimization (DRO) with six concrete algorithms, including Wasserstein Gradient Flow (Algorithm 3) and Wasserstein Fisher-Rao flow (Algorithm 4) variants for entropy-regularized Wasserstein DRO (Section 4, Algorithms 3-4).", + "Proposition 1 shows the Wasserstein gradient flow sampler must run for time at least on the order of O((1/λ) log(L/√(λε))) to produce an ε-accurate gradient estimate (Section 4, Proposition 1).", + "Theorem 1 proves the outer loop of the gradient-flow-sampler-based DRO algorithm requires O(1/ε²_opt) iterations to reach an ε-stationary point (Section 5, Theorem 1).", + "Theorem 2 bounds the total computational complexity of the WGF-based DRO algorithm (Algorithm 3) as Õ(L_Φ L²_U L²_f d² / (λ³_U ε⁴_opt)) (Section 5, Theorem 2).", + "On CIFAR-10 adversarial training under PGD attacks, the WFR- and WGF-based DRO methods achieve consistently higher robust accuracy across all perturbation settings compared to baseline DRO methods (Section 6.3).", + "Lemma 1 establishes that the entropy-regularized DRO problem is equivalent to a Schrödinger half-bridge problem, enabling sampling from the conditional worst-case distribution (Section 3.1, Lemma 1).", +] + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as handle: + for block in iter(lambda: handle.read(1 << 20), b""): + h.update(block) + return h.hexdigest() + + +def write_csv(path: Path, rows: list[dict]) -> None: + fieldnames = [] + for row in rows: + for key in row: + if key not in fieldnames: + fieldnames.append(key) + with path.open("w", newline="", encoding="utf-8") as handle: + writer = csv.DictWriter(handle, fieldnames=fieldnames) + writer.writeheader() + writer.writerows(rows) + + +def source_audit(root: Path) -> tuple[list[dict], dict]: + v1 = (root / "source_v1" / "main.tex").read_text(encoding="utf-8") + current = (root / "source_current" / "main.tex").read_text(encoding="utf-8") + anchors = [ + (1, "label{alg:SDRO-NGD}", "label{alg:SDRO-WFR}"), + (2, "label{prop:gradient_oracle_error_control}", "log{\\frac{L}{\\sqrt{\\lambda}\\epsilon}}"), + (3, "label{thm:outer_loop}", "S = O(1/\\epsilon_{\\text{opt}}^2)"), + (4, "label{thm:ula}", "\\epsilon_{\\text{opt}}^4"), + (5, "label{fig:robustness}", "WFR and WGF, in particular, consistently achieve"), + (6, "label{lem:sb-klform}", "Schr\\\"odinger half bridge problem"), + ] + rows = [] + for claim, anchor, companion in anchors: + rows.append({ + "claim": claim, + "v1_anchor": anchor, + "anchor_present": int(anchor in v1), + "v1_companion": companion, + "companion_present": int(companion in v1), + }) + algorithm_labels = [ + "alg:sampler", "alg:GF-DRO", "alg:SDRO-NGD", "alg:SDRO-WFR", + "alg:SDRO-SVG", "alg:SDRO_rgo", + ] + inventory = [{"algorithm": i + 1, "label": label, "present": int(f"label{{{label}}}" in v1)} for i, label in enumerate(algorithm_labels)] + return rows + inventory, { + "v1_pdf_hash_exact": sha256(root / "paper_v1.pdf") == V1_PDF_SHA256, + "v1_source_hash_exact": sha256(root / "source_v1.tar.gz") == V1_SOURCE_SHA256, + "current_pdf_hash_exact": sha256(root / "paper_current.pdf") == CURRENT_PDF_SHA256, + "current_source_hash_exact": sha256(root / "source_current.tar.gz") == CURRENT_SOURCE_SHA256, + "v1_claim_anchors": sum(int(r["anchor_present"] and r["companion_present"]) for r in rows), + "six_algorithm_labels": sum(r["present"] for r in inventory), + "rate_drift_detected": ( + "S = O(1/\\epsilon_{\\text{opt}}^2)" in v1 + and "S = O(\\frac1{\\epsilon_{\\text{opt}}^4})" in current + and "\\epsilon_{\\text{opt}}^6" in current + ), + } + + +def flow_time_audit() -> tuple[list[dict], dict]: + rows = [] + for lam in (0.25, 0.5, 1.0, 2.0, 4.0): + for lipschitz in (0.75, 1.5, 3.0): + for epsilon in (0.2, 0.1, 0.05, 0.02, 0.01): + initial_error = lipschitz / math.sqrt(lam) + threshold = math.log(initial_error / epsilon) / lam + at_threshold = initial_error * math.exp(-lam * threshold) + early = initial_error * math.exp(-lam * 0.8 * threshold) + rows.append({ + "lambda": lam, + "L": lipschitz, + "epsilon": epsilon, + "threshold_time": threshold, + "error_at_threshold": at_threshold, + "error_at_80pct_time": early, + "threshold_pass": int(at_threshold <= epsilon * (1 + 1e-12)), + "early_control_fails": int(early > epsilon), + }) + return rows, { + "cells": len(rows), + "max_threshold_ratio_error": max(abs(r["error_at_threshold"] / r["epsilon"] - 1.0) for r in rows), + "all_thresholds_pass": all(r["threshold_pass"] for r in rows), + "all_early_controls_fail": all(r["early_control_fails"] for r in rows), + } + + +def complexity_audit() -> tuple[list[dict], dict]: + rows = [] + for eps in (0.4, 0.25, 0.16, 0.1, 0.063, 0.04): + outer = eps ** -2 + for d in (2, 8, 32, 128): + for l_phi, l_u, l_f, lam_u in ((1.0, 1.0, 1.0, 1.0), (2.0, 1.5, 0.75, 0.5)): + prefactor = l_phi * l_u**2 * l_f**2 * d**2 / lam_u**3 + total = prefactor * eps ** -4 * math.log(1.0 / eps) + rows.append({ + "epsilon_opt": eps, "dimension": d, "L_phi": l_phi, + "L_U": l_u, "L_f": l_f, "lambda_U": lam_u, + "outer_iterations_proxy": outer, + "outer_normalized": outer * eps**2, + "total_complexity_proxy": total, + "total_normalized": total * eps**4 / (math.log(1.0 / eps) * prefactor), + }) + eps_grid = np.asarray(sorted({r["epsilon_opt"] for r in rows})) + outer_grid = eps_grid ** -2 + plain_total = eps_grid ** -4 + slope_outer = float(np.polyfit(np.log(eps_grid), np.log(outer_grid), 1)[0]) + slope_total = float(np.polyfit(np.log(eps_grid), np.log(plain_total), 1)[0]) + return rows, { + "cells": len(rows), + "outer_exponent": slope_outer, + "total_polynomial_exponent": slope_total, + "max_outer_identity_error": max(abs(r["outer_normalized"] - 1.0) for r in rows), + "max_total_identity_error": max(abs(r["total_normalized"] - 1.0) for r in rows), + } + + +def half_bridge_audit() -> tuple[list[dict], dict]: + rows = [] + xs = np.asarray([-1.0, 0.0, 1.0]) + px = np.asarray([0.2, 0.5, 0.3]) + ys = np.linspace(-2.0, 2.0, 17) + for tau in (0.2, 0.5, 1.0): + for epsilon in (0.25, 0.5, 1.0): + costs = (xs[:, None] - ys[None, :]) ** 2 + potential = 0.35 * ys**2 - 0.4 * ys + logits = -(2.0 * tau * potential[None, :] + costs) / epsilon + logits -= logits.max(axis=1, keepdims=True) + cond = np.exp(logits) + cond /= cond.sum(axis=1, keepdims=True) + coupling = px[:, None] * cond + marginal_y = coupling.sum(axis=0) + # Stationarity of each conditional Gibbs problem: energy + eps log q + # is constant over y for a fixed x (up to the row multiplier). + kkt = 2.0 * tau * potential[None, :] + costs + epsilon * np.log(cond) + kkt_residual = float(np.max(np.ptp(kkt, axis=1))) + mixture_error = float(np.max(np.abs(marginal_y - np.sum(px[:, None] * cond, axis=0)))) + rows.append({ + "tau": tau, "epsilon": epsilon, + "max_fixed_x_marginal_error": float(np.max(np.abs(coupling.sum(axis=1) - px))), + "max_conditional_normalization_error": float(np.max(np.abs(cond.sum(axis=1) - 1.0))), + "kkt_residual": kkt_residual, + "mixture_identity_error": mixture_error, + "marginal_y_mean": float(np.dot(marginal_y, ys)), + }) + return rows, { + "cells": len(rows), + "max_fixed_marginal_error": max(r["max_fixed_x_marginal_error"] for r in rows), + "max_conditional_normalization_error": max(r["max_conditional_normalization_error"] for r in rows), + "max_kkt_residual": max(r["kkt_residual"] for r in rows), + "max_mixture_identity_error": max(r["mixture_identity_error"] for r in rows), + } + + +def source_cifar_audit(root: Path) -> tuple[list[dict], dict]: + v1 = (root / "source_v1" / "main.tex").read_text(encoding="utf-8") + figures = ["rgo_lam=10_eps=0.2.pdf", "rgo_lam=10_eps=0.02.pdf", "rgo_lam=10_eps=0.002.pdf"] + rows = [{"epsilon": eps, "figure": name, "sha256": sha256(root / "source_v1" / name), "nonempty": int((root / "source_v1" / name).stat().st_size > 1000)} for eps, name in zip((0.2, 0.02, 0.002), figures)] + return rows, { + "three_primary_figures": len(rows) == 3 and all(r["nonempty"] for r in rows), + "cifar_setup_present": "features extracted from the real-world image dataset CIFAR-10" in v1 and "vary $\\Delta$ from 0 to 0.08" in v1, + "wfr_wgf_source_conclusion_present": "WFR and WGF, in particular, consistently achieve a high degree of robustness across all settings" in v1, + } + + +def make_figure(path: Path, flow: list[dict], complexity: list[dict], bridge: list[dict]) -> None: + fig, axes = plt.subplots(1, 3, figsize=(15, 4.6)) + subset = [r for r in flow if r["lambda"] == 1.0 and r["L"] == 1.5] + axes[0].loglog([r["epsilon"] for r in subset], [r["threshold_time"] for r in subset], "o-") + axes[0].set(title="Proposition 1 flow time", xlabel="epsilon", ylabel="threshold time") + eps = sorted({r["epsilon_opt"] for r in complexity}) + axes[1].loglog(eps, [e**-2 for e in eps], "o-", label="outer") + axes[1].loglog(eps, [e**-4 for e in eps], "s-", label="total polynomial") + axes[1].set(title="V1 complexity exponents", xlabel="epsilon_opt", ylabel="normalized work") + axes[1].legend(frameon=False) + axes[2].plot(range(len(bridge)), [r["marginal_y_mean"] for r in bridge], "o-") + axes[2].set(title="Half-bridge Gibbs mixtures", xlabel="parameter cell", ylabel="worst-case mean") + for ax in axes: + ax.grid(alpha=0.25) + fig.suptitle("Gradient-flow DRO: version-locked exact audits", weight="bold") + fig.tight_layout() + fig.savefig(path, dpi=180) + plt.close(fig) + + +def main() -> None: + parser = argparse.ArgumentParser() + parser.add_argument("--output-dir", type=Path, default=Path("outputs")) + args = parser.parse_args() + out = args.output_dir + out.mkdir(parents=True, exist_ok=True) + root = Path(__file__).resolve().parent + + source_rows, source = source_audit(root) + flow_rows, flow = flow_time_audit() + complexity_rows, complexity = complexity_audit() + bridge_rows, bridge = half_bridge_audit() + cifar_rows, cifar = source_cifar_audit(root) + gates = { + "four_primary_hashes_exact": all(source[k] for k in ("v1_pdf_hash_exact", "v1_source_hash_exact", "current_pdf_hash_exact", "current_source_hash_exact")), + "six_exact_live_claims": len(CLAIMS) == 6, + "six_v1_claim_anchors": source["v1_claim_anchors"] == 6, + "six_concrete_algorithms": source["six_algorithm_labels"] == 6, + "material_rate_drift_detected": source["rate_drift_detected"], + "flow_time_grid_complete": flow["cells"] == 75, + "flow_time_threshold_exact": flow["all_thresholds_pass"] and flow["max_threshold_ratio_error"] < 1e-12, + "early_flow_destructive_control": flow["all_early_controls_fail"], + "complexity_grid_complete": complexity["cells"] == 48, + "outer_rate_exponent": abs(complexity["outer_exponent"] + 2.0) < 1e-12, + "total_rate_exponent": abs(complexity["total_polynomial_exponent"] + 4.0) < 1e-12, + "complexity_identities_exact": complexity["max_outer_identity_error"] < 1e-12 and complexity["max_total_identity_error"] < 1e-12, + "half_bridge_grid_complete": bridge["cells"] == 9, + "half_bridge_fixed_marginal": bridge["max_fixed_marginal_error"] < 1e-14, + "half_bridge_gibbs_kkt": bridge["max_kkt_residual"] < 1e-12, + "half_bridge_mixture_identity": bridge["max_mixture_identity_error"] < 1e-14, + "three_primary_cifar_figures": cifar["three_primary_figures"], + "cifar_setup_and_conclusion_pinned": cifar["cifar_setup_present"] and cifar["wfr_wgf_source_conclusion_present"], + } + write_csv(out / "source_and_algorithm_audit.csv", source_rows) + write_csv(out / "flow_time_thresholds.csv", flow_rows) + write_csv(out / "complexity_rates.csv", complexity_rows) + write_csv(out / "half_bridge_gibbs.csv", bridge_rows) + write_csv(out / "source_cifar_figures.csv", cifar_rows) + make_figure(out / "gradient_flow_dro_audit.png", flow_rows, complexity_rows, bridge_rows) + result = { + "paper_id": PAPER_ID, + "claims": CLAIMS, + "source": source, + "flow_time": flow, + "complexity": complexity, + "half_bridge": bridge, + "cifar_source": cifar, + "gates": gates, + "all_gates_pass": all(gates.values()), + "scope": { + "literal_claim_source": "arXiv v1", + "current_revision": "material rate-drift control", + "cifar_results": "pinned primary figures and source conclusion; not independently rerun", + "finite_audits": "exact mechanisms and rate identities; not replacements for universal proofs", + }, + } + (out / "results.json").write_text(json.dumps(result, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + hashes = {p.name: sha256(p) for p in sorted(out.iterdir()) if p.is_file() and p.name != "SHA256SUMS.json"} + (out / "SHA256SUMS.json").write_text(json.dumps(hashes, indent=2) + "\n", encoding="utf-8") + print(json.dumps({"all_gates_pass": result["all_gates_pass"], "passed": sum(gates.values()), "total": len(gates), "output": str(out)}, indent=2)) + if not result["all_gates_pass"]: + raise SystemExit("one or more gates failed") + + +if __name__ == "__main__": + main() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e5c2d25367265767a3973662dc451168072fb355 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +numpy==2.2.4 +matplotlib==3.10.3 diff --git a/source_current.tar.gz b/source_current.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..52450bff1f7af71f9eaa353df8b6fe62cbac839b --- /dev/null +++ b/source_current.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc00b5195a2592b24f9b876bf9fd27ada78fa9a46c468e81221983943cb726e5 +size 17818727 diff --git a/source_current/00README.json b/source_current/00README.json new file mode 100644 index 0000000000000000000000000000000000000000..4b733249f1c36ef7d7504b4cf43ae97e06177f8b --- /dev/null +++ b/source_current/00README.json @@ -0,0 +1,13 @@ +{ + "sources" : [ + { + "usage" : "toplevel", + "filename" : "main.tex" + } + ], + "spec_version" : 1, + "texlive_version" : "2025", + "process" : { + "compiler" : "pdflatex" + } +} diff --git a/source_current/1_exp_convergence.pdf b/source_current/1_exp_convergence.pdf new file mode 100644 index 0000000000000000000000000000000000000000..03c76bfcd08fee2c1483f03d1bb83c702af08f1b --- /dev/null +++ b/source_current/1_exp_convergence.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d301f140970834e394d3003901163ee4e3a5b41509cd4c056c9a961812befd9d +size 3953665 diff --git a/source_current/2000.pdf b/source_current/2000.pdf new file mode 100644 index 0000000000000000000000000000000000000000..884d75afe92fd998b55b12eb07881ec1a5a47a9b Binary files /dev/null and b/source_current/2000.pdf differ diff --git a/source_current/Bibliography.bib b/source_current/Bibliography.bib new file mode 100644 index 0000000000000000000000000000000000000000..5c4096ef2e5693a065725fe97a7f9af404c47b2a --- /dev/null +++ b/source_current/Bibliography.bib @@ -0,0 +1,640 @@ +@article{mielkeNotesHellingerDistance2025, + title={Some notes on the {Hellinger} distance and various {Fisher-Rao} distances}, + author={Mielke, Alexander}, + journal={arXiv preprint arXiv:2510.02537}, + year={2025} +} + +@article{carrillo2024fisher, + title = {{Fisher-Rao} gradient flow: geodesic convexity and functional inequalities}, + author = {Carrillo, Jos{\'e} A and Chen, Yifan and Huang, Daniel Zhengyu and Huang, Jiaoyang and Wei, Dongyi}, + journal = {arXiv preprint arXiv:2407.15693}, + year = {2024} +} + +@article{chen2023sampling, + title = {Sampling via gradient flows in the space of probability measures}, + author = {Chen, Yifan and Huang, Daniel Zhengyu and Huang, Jiaoyang and Reich, Sebastian and Stuart, Andrew M}, + journal = {arXiv preprint arXiv:2310.03597}, + year = {2023} +} + +@book{ambrosio2008gradient, + title = {Gradient flows: In metric spaces and in the space of probability measures}, + author = {Ambrosio, Luigi and Gigli, Nicola and Savare, Giuseppe}, + year = {2005}, + publisher = {Springer Science \& Business Media} +} + +@article{delageDistributionallyRobustOptimization2010, + title = {Distributionally robust optimization under moment uncertainty with application to data-driven problems}, + author = {Delage, Erick and Ye, Yinyu}, + year = {2010}, + journal = {Operations research}, + volume = {58}, + number = {3}, + pages = {595--612}, + publisher = {INFORMS} +} + +@article{ben-talRobustSolutionsOptimization2013, + title = {Robust solutions of optimization problems affected by uncertain probabilities}, + author = {{Ben-Tal}, Aharon and {den Hertog}, Dick and De Waegenaere, Anja and Melenberg, Bertrand and Rennen, Gijs}, + year = {2013}, + month = feb, + journal = {Management Science}, + volume = {59}, + number = {2}, + pages = {341--357}, + issn = {0025-1909, 1526-5501}, + doi = {10.1287/mnsc.1120.1641}, + urldate = {2022-03-02}, + langid = {english} +} + +@article{levyLargeScaleMethodsDistributionally2020, + title={Large-scale methods for distributionally robust optimization}, + author={Levy, Daniel and Carmon, Yair and Duchi, John C and Sidford, Aaron}, + journal={Advances in neural information processing systems}, + volume={33}, + pages={8847--8860}, + year={2020} +} + +@article{kuhnDistributionallyRobustOptimization2024, + title={Distributionally robust optimization}, + author={Kuhn, Daniel and Shafiee, Soroosh and Wiesemann, Wolfram}, + journal={Acta Numerica}, + volume={34}, + pages={579--804}, + year={2025}, + publisher={Cambridge University Press} +} + +@article{gallouetJKOSplittingScheme2018, + title = {A {JKO} splitting scheme for {Kantorovich-Fisher-Rao} gradient flows}, + author = {Gallou{\"e}t, Thomas and Monsaingeon, L{\'e}onard}, + year = {2018}, + month = may, + number = {arXiv:1602.04457}, + eprint = {1602.04457}, + primaryclass = {math}, + publisher = {arXiv}, + doi = {10.48550/arXiv.1602.04457}, + urldate = {2023-01-15}, + archiveprefix = {arXiv}, + keywords = {35K15 35K57 35K65 47J30,Mathematics - Analysis of PDEs} +} + +@inproceedings{yuFastDistributionallyRobust2022, + title = {Fast distributionally robust learning with variance-reduced min-max optimization}, + booktitle = {Proceedings of {{The}} 25th {{International Conference}} on {{Artificial Intelligence}} and {{Statistics}}}, + author = {Yu, Yaodong and Lin, Tianyi and Mazumdar, Eric V. and Jordan, Michael}, + year = {2022}, + month = may, + pages = {1219--1250}, + publisher = {PMLR}, + issn = {2640-3498}, + urldate = {2022-07-22}, + langid = {english} +} + +@inproceedings{congerStrategicDistributionShift2023, + title = {Strategic distribution shift of interacting agents via coupled gradient flows}, + booktitle = {Thirty-Seventh {{Conference}} on {{Neural Information Processing Systems}}}, + author = {Conger, Lauren E. and Hoffman, Franca and Mazumdar, Eric and Ratliff, Lillian J.}, + year = {2023}, + month = nov, + urldate = {2023-12-21}, + langid = {english} +} + +@article{trillosAdversarialRobustnessUse2023, + title={On adversarial robustness and the use of {Wasserstein} ascent-descent dynamics to enforce it}, + author={Garc{\'\i}a Trillos, Camilo Andr{\'e}s and Garc{\'\i}a Trillos, Nicol{\'a}s}, + journal={Information and Inference: A Journal of the IMA}, + volume={13}, + number={3}, + pages={iaae018}, + year={2024}, + publisher={Oxford University Press} +} + +@article{luAcceleratingLangevinSampling2019, + title={Accelerating {Langevin} sampling with birth-death}, + author={Lu, Yulong and Lu, Jianfeng and Nolen, James}, + journal={arXiv preprint arXiv:1905.09863}, + year={2019} +} + +@article{luBirthdeathDynamicsSampling2023, + title = {Birth-death dynamics for sampling: Global convergence, approximations and their asymptotics}, + shorttitle = {Birth-Death Dynamics for Sampling}, + author = {Lu, Yulong and Slep{\v c}ev, Dejan and Wang, Lihan}, + year = {2023}, + month = nov, + journal = {Nonlinearity}, + volume = {36}, + number = {11}, + eprint = {2211.00450}, + primaryclass = {math, stat}, + pages = {5731--5772}, + issn = {0951-7715, 1361-6544}, + doi = {10.1088/1361-6544/acf988}, + urldate = {2023-12-25}, + archiveprefix = {arXiv}, + keywords = {Mathematics - Analysis of PDEs,Mathematics - Probability,Statistics - Machine Learning} +} + +@article{mielke2025hellinger, + title = {{Hellinger-Kantorovich} gradient flows: Global exponential decay of entropy functionals}, + author = {Mielke, Alexander and Zhu, Jia-Jie}, + journal = {arXiv preprint arXiv:2501.17049}, + year = {2025} +} + +@article{wang2022exponentially, + title = {An exponentially converging particle method for the mixed {Nash} equilibrium of continuous games}, + author = {Wang, Guillaume and Chizat, L{\'e}na{\"\i}c}, + journal = {arXiv preprint arXiv:2211.01280}, + year = {2022} +} + +@article{gaoDistributionallyRobustStochastic2016, + title = {Distributionally robust stochastic optimization with {Wasserstein} distance}, + author = {Gao, Rui and Kleywegt, Anton J.}, + year = {2016}, + journal = {arXiv preprint arXiv:1604.02199}, +} + +@article{zhaoDatadrivenRiskaverseStochastic2018, + title = {Data-driven risk-averse stochastic optimization with {Wasserstein} metric}, + author = {Zhao, Chaoyue and Guan, Yongpei}, + year = {2018}, + month = mar, + journal = {Operations Research Letters}, + volume = {46}, + number = {2}, + pages = {262--267}, + issn = {01676377}, + doi = {10.1016/j.orl.2018.01.011}, + urldate = {2022-03-03}, + langid = {english} +} + +@article{wang2021sinkhorn, + title={{Sinkhorn} distributionally robust optimization}, + author={Wang, Jie and Gao, Rui and Xie, Yao}, + journal={arXiv preprint arXiv:2109.11926}, + year={2021} +} + +@inproceedings{lee2021structured, + title={Structured logconcave sampling with a restricted {Gaussian} oracle}, + author={Lee, Yin Tat and Shen, Ruoqi and Tian, Kevin}, + booktitle={Conference on Learning Theory}, + pages={2993--3050}, + year={2021}, + organization={PMLR} +} + +@article{sinha2020certifyingdistributionalrobustnessprincipled, + title={Certifying some distributional robustness with principled adversarial training}, + author={Sinha, Aman and Namkoong, Hongseok and Volpi, Riccardo and Duchi, John}, + journal={arXiv preprint arXiv:1710.10571}, + year={2017} +} + +@inproceedings{chen2022improved, + title={Improved analysis for a proximal algorithm for sampling}, + author={Chen, Yongxin and Chewi, Sinho and Salim, Adil and Wibisono, Andre}, + booktitle={Conference on Learning Theory}, + pages={2984--3014}, + year={2022}, + organization={PMLR} +} + +@article{bertsimas2020predictive, + title={From predictive to prescriptive analytics}, + author={Bertsimas, Dimitris and Kallus, Nathan}, + journal={Management Science}, + volume={66}, + number={3}, + pages={1025--1044}, + year={2020}, + publisher={INFORMS} +} + +@article{chewi2024statistical, + title={Statistical optimal transport}, + author={Chewi, Sinho and Niles-Weed, Jonathan and Rigollet, Philippe}, + journal={arXiv preprint arXiv:2407.18163}, + year={2024} +} + +@article{xu2018global, + title={Global convergence of {Langevin} dynamics based algorithms for nonconvex optimization}, + author={Xu, Pan and Chen, Jinghui and Zou, Difan and Gu, Quanquan}, + journal={Advances in Neural Information Processing Systems}, + volume={31}, + year={2018} +} + +@article{hwang1980laplace, + title={{Laplace's} method revisited: weak convergence of probability measures}, + author={Hwang, Chii-Ruey}, + journal={The Annals of Probability}, + pages={1177--1182}, + year={1980}, + publisher={JSTOR} +} + +@article{gelfand1991recursive, + title={Recursive stochastic algorithms for global optimization in {R}\^{}d}, + author={Gelfand, Saul B and Mitter, Sanjoy K}, + journal={SIAM Journal on Control and Optimization}, + volume={29}, + number={5}, + pages={999--1018}, + year={1991}, + publisher={SIAM} +} + +@article{roberts1996exponential, + title={Exponential convergence of {Langevin} distributions and their discrete approximations}, + author={Roberts, Gareth O and Tweedie, Richard L}, + year={1996} +} + +@article{tan2023accelerate, + title={Accelerate {Langevin} sampling with birth-death process and exploration component}, + author={Tan, Lezhi and Lu, Jianfeng}, + journal={arXiv preprint arXiv:2305.05529}, + year={2023} +} + +@article{mohajerin2018data, + title={Data-driven distributionally robust optimization using the {Wasserstein} metric: Performance guarantees and tractable reformulations}, + author={Mohajerin Esfahani, Peyman and Kuhn, Daniel}, + journal={Mathematical Programming}, + volume={171}, + number={1}, + pages={115--166}, + year={2018}, + publisher={Springer} +} + +@article{nusken2024stein, + title={{Stein} transport for {Bayesian} inference}, + author={N{\"u}sken, Nikolas}, + journal={arXiv preprint arXiv:2409.01464}, + year={2024} +} + +@article{liu2016stein, + title={{Stein} variational gradient descent: A general purpose {Bayesian} inference algorithm}, + author={Liu, Qiang and Wang, Dilin}, + journal={Advances in neural information processing systems}, + volume={29}, + year={2016} +} + +@article{heng2024diffusion, + title={Diffusion {Schr{\"o}dinger} bridges for {Bayesian} computation}, + author={Heng, Jeremy and De Bortoli, Valentin and Doucet, Arnaud}, + journal={Statistical Science}, + volume={39}, + number={1}, + pages={90--99}, + year={2024}, + publisher={Institute of Mathematical Statistics} +} + +@article{hu2013kullback, + title={{Kullback-Leibler} divergence constrained distributionally robust optimization}, + author={Hu, Zhaolin and Hong, L Jeff}, + journal={Available at Optimization Online}, + volume={1}, + number={2}, + pages={9}, + year={2013} +} + +@article{maurais2024sampling, + title={Sampling in unit time with kernel {Fisher-Rao} flow}, + author={Maurais, Aimee and Marzouk, Youssef}, + journal={arXiv preprint arXiv:2401.03892}, + year={2024} +} + +@article{ghadimi2013stochastic, + title={Stochastic first-and zeroth-order methods for nonconvex stochastic programming}, + author={Ghadimi, Saeed and Lan, Guanghui}, + journal={SIAM journal on optimization}, + volume={23}, + number={4}, + pages={2341--2368}, + year={2013}, + publisher={SIAM} +} + +@article{vempala2019rapid, + title={Rapid convergence of the unadjusted {Langevin} algorithm: Isoperimetry suffices}, + author={Vempala, Santosh and Wibisono, Andre}, + journal={Advances in neural information processing systems}, + volume={32}, + year={2019} +} + +@article{talagrand1996transportation, + title={Transportation cost for {Gaussian} and other product measures}, + author={Talagrand, Michel}, + journal={Geometric \& Functional Analysis GAFA}, + volume={6}, + number={3}, + pages={587--600}, + year={1996}, + publisher={Springer} +} + +@article{zhu2024distributionally, + title={Distributionally robust optimization via iterative algorithms in continuous probability spaces}, + author={Zhu, Linglingzhi and Xie, Yao}, + journal={arXiv preprint arXiv:2412.20556}, + year={2024} +} + +@article{xu2024flow, + title={Flow-based distributionally robust optimization}, + author={Xu, Chen and Lee, Jonghyeok and Cheng, Xiuyuan and Xie, Yao}, + journal={IEEE Journal on Selected Areas in Information Theory}, + volume={5}, + pages={62--77}, + year={2024}, + publisher={IEEE} +} + +@inproceedings{zhu2021kernel, + title={Kernel distributionally robust optimization: Generalized duality theorem and stochastic approximation}, + author={Zhu, Jia-Jie and Jitkrittum, Wittawat and Diehl, Moritz and Sch{\"o}lkopf, Bernhard}, + booktitle={International Conference on Artificial Intelligence and Statistics}, + pages={280--288}, + year={2021}, + organization={PMLR} +} + +@article{el1997robust, + title={Robust solutions to least-squares problems with uncertain data}, + author={El Ghaoui, Laurent and Lebret, Herv{\'e}}, + journal={SIAM Journal on matrix analysis and applications}, + volume={18}, + number={4}, + pages={1035--1064}, + year={1997}, + publisher={SIAM} +} + +@misc{krizhevsky2009learning, + title={Learning multiple layers of features from tiny images.(2009)}, + author={Krizhevsky, Alex and Hinton, Geoffrey and others}, + year={2009} +} + +@book{otto1996double, + title={Double degenerate diffusion equations as steepest descent}, + author={Otto, Felix}, + year={1996}, + publisher={Sonderforschungsbereich 256} +} + +@article{garcia2018continuum, + title={Continuum limits of posteriors in graph {Bayesian} inverse problems}, + author={Garc{\'\i}a Trillos, Nicolás and Sanz-Alonso, Daniel}, + journal={SIAM Journal on Mathematical Analysis}, + volume={50}, + number={4}, + pages={4020--4040}, + year={2018}, + publisher={SIAM} +} + +@article{onsagerFluctuationsIrreversibleProcesses1953, + title={Fluctuations and irreversible processes}, + author={Onsager, Lars and Machlup, Stefan}, + journal={Physical Review}, + volume={91}, + number={6}, + pages={1505}, + year={1953}, + publisher={APS} +} + +@article{onsagerReciprocalRelationsIrreversible1931, + title={Reciprocal relations in irreversible processes. I.}, + author={Onsager, Lars}, + journal={Physical review}, + volume={37}, + number={4}, + pages={405}, + year={1931}, + publisher={APS} +} + +@article{mielkeNonequilibriumThermodynamicalPrinciples2017, + title={Non-equilibrium thermodynamical principles for chemical reactions with mass-action kinetics}, + author={Mielke, Alexander and Patterson, Robert IA and Peletier, Mark A and Michiel Renger, DR3691731}, + journal={SIAM Journal on Applied Mathematics}, + volume={77}, + number={4}, + pages={1562--1585}, + year={2017}, + publisher={SIAM} +} + +@article{ottoGeometryDissipativeEvolution2001, + title={The geometry of dissipative evolution equations: the porous medium equation}, + author={Otto, Felix}, + year={2001}, + publisher={Taylor \& Francis} +} + +@article{mielke2023introduction, + title={An introduction to the analysis of gradients systems}, + author={Mielke, Alexander}, + journal={arXiv preprint arXiv:2306.05026}, + year={2023} +} + +@article{wibisono2025mixing, + title={Mixing time of the proximal sampler in relative {Fisher} information via strong data processing inequality}, + author={Wibisono, Andre}, + journal={arXiv preprint arXiv:2502.05623}, + year={2025} +} + +@inproceedings{chewi2022query, + title={The query complexity of sampling from strongly log-concave distributions in one dimension}, + author={Chewi, Sinho and Gerber, Patrik R and Lu, Chen and Le Gouic, Thibaut and Rigollet, Philippe}, + booktitle={Conference on Learning Theory}, + pages={2041--2059}, + year={2022}, + organization={PMLR} +} + +@inproceedings{ba2021understanding, + title={Understanding the variance collapse of {SVGD} in high dimensions}, + author={Ba, Jimmy and Erdogdu, Murat A and Ghassemi, Marzyeh and Sun, Shengyang and Suzuki, Taiji and Wu, Denny and Zhang, Tianzong}, + booktitle={International Conference on Learning Representations}, + year={2021} +} + +@inproceedings{salim2022convergence, + title={A convergence theory for {SVGD} in the population limit under {Talagrand's} inequality {T1}}, + author={Salim, Adil and Sun, Lukang and Richtarik, Peter}, + booktitle={International Conference on Machine Learning}, + pages={19139--19152}, + year={2022}, + organization={PMLR} +} + +@inproceedings{zhuo2018message, + title={Message passing {Stein} variational gradient descent}, + author={Zhuo, Jingwei and Liu, Chang and Shi, Jiaxin and Zhu, Jun and Chen, Ning and Zhang, Bo}, + booktitle={International Conference on Machine Learning}, + pages={6018--6027}, + year={2018}, + organization={PMLR} +} + +@article{shi2023finite, + title={A finite-particle convergence rate for {Stein} variational gradient descent}, + author={Shi, Jiaxin and Mackey, Lester}, + journal={Advances in Neural Information Processing Systems}, + volume={36}, + pages={26831--26844}, + year={2023} +} + +@article{gross1975logarithmic, + title={Logarithmic {Sobolev} inequalities}, + author={Gross, Leonard}, + journal={American Journal of Mathematics}, + volume={97}, + number={4}, + pages={1061--1083}, + year={1975}, + publisher={JSTOR} +} + +@inproceedings{blanchet2015unbiased, + title={Unbiased {Monte Carlo} for optimization and functions of expectations via multi-level randomization}, + author={Blanchet, Jose H and Glynn, Peter W}, + booktitle={2015 Winter Simulation Conference (WSC)}, + pages={3656--3667}, + year={2015}, + organization={IEEE} +} + +@inproceedings{pidhorskyi2020adversarial, + title={Adversarial latent autoencoders}, + author={Pidhorskyi, Stanislav and Adjeroh, Donald A and Doretto, Gianfranco}, + booktitle={Proceedings of the IEEE/CVF conference on computer vision and pattern recognition}, + pages={14104--14113}, + year={2020} +} + +@article{lecun2002gradient, + title={Gradient-based learning applied to document recognition}, + author={LeCun, Yann and Bottou, L{\'e}on and Bengio, Yoshua and Haffner, Patrick}, + journal={Proceedings of the IEEE}, + volume={86}, + number={11}, + pages={2278--2324}, + year={2002}, + publisher={Ieee} +} + +@article{jordan1998variational, + title={The variational formulation of the {Fokker--Planck} equation}, + author={Jordan, Richard and Kinderlehrer, David and Otto, Felix}, + journal={SIAM journal on mathematical analysis}, + volume={29}, + number={1}, + pages={1--17}, + year={1998}, + publisher={SIAM} +} + +@article{otto2000generalization, + title={Generalization of an inequality by {Talagrand} and links with the logarithmic {Sobolev} inequality}, + author={Otto, Felix and Villani, C{\'e}dric}, + journal={Journal of Functional Analysis}, + volume={173}, + number={2}, + pages={361--400}, + year={2000}, + publisher={Elsevier} +} + +@article{peyre2015entropic, + title={Entropic approximation of {Wasserstein} gradient flows}, + author={Peyr{\'e}, Gabriel}, + journal={SIAM Journal on Imaging Sciences}, + volume={8}, + number={4}, + pages={2323--2351}, + year={2015}, + publisher={SIAM} +} + +@article{wang2025iterative, + title={Iterative sampling methods for {Sinkhorn} distributionally robust optimization}, + author={Wang, Jie}, + journal={arXiv preprint arXiv:2512.12550}, + year={2025} +} + +@article{dapogny2023entropy, + title={Entropy-regularized {Wasserstein} distributionally robust shape and topology optimization}, + author={Dapogny, Charles and Iutzeler, Franck and Meda, Andrea and Thibert, Boris}, + journal={Structural and Multidisciplinary Optimization}, + volume={66}, + number={3}, + pages={42}, + year={2023}, + publisher={Springer} +} + +@article{nemirovski2009robust, + title={Robust stochastic approximation approach to stochastic programming}, + author={Nemirovski, Arkadi and Juditsky, Anatoli and Lan, Guanghui and Shapiro, Alexander}, + journal={SIAM Journal on optimization}, + volume={19}, + number={4}, + pages={1574--1609}, + year={2009}, + publisher={SIAM} +} + +@article{madry2017towards, + title={Towards deep learning models resistant to adversarial attacks}, + author={Madry, Aleksander and Makelov, Aleksandar and Schmidt, Ludwig and Tsipras, Dimitris and Vladu, Adrian}, + journal={arXiv preprint arXiv:1706.06083}, + year={2017} +} + +@article{johnston2025performance, + title={The performance of the unadjusted {Langevin} algorithm without smoothness assumptions}, + author={Johnston, Tim and Lytras, Iosif and Makras, Nikolaos and Sabanis, Sotirios}, + journal={arXiv preprint arXiv:2502.03458}, + year={2025} +} + +@inproceedings{kantorovich1942translocation, + title={On the translocation of masses}, + author={Kantorovich, Leonid V}, + booktitle={Dokl. Akad. Nauk. USSR (NS)}, + volume={37}, + pages={199--201}, + year={1942} +} \ No newline at end of file diff --git a/source_current/WFR_frame_000_samples.pdf b/source_current/WFR_frame_000_samples.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a102efc1fd179d7ad2a455215eb296aadbbbd3d0 Binary files /dev/null and b/source_current/WFR_frame_000_samples.pdf differ diff --git a/source_current/WRM_frame_000_samples.pdf b/source_current/WRM_frame_000_samples.pdf new file mode 100644 index 0000000000000000000000000000000000000000..051e6af59c96a0ae09feac77c840d1d7135f8cb3 Binary files /dev/null and b/source_current/WRM_frame_000_samples.pdf differ diff --git a/source_current/arxiv.sty b/source_current/arxiv.sty new file mode 100644 index 0000000000000000000000000000000000000000..e8fd2fca0dd689ff160045d34df763bc4239bc9b --- /dev/null +++ b/source_current/arxiv.sty @@ -0,0 +1,255 @@ +\NeedsTeXFormat{LaTeX2e} + +\ProcessOptions\relax + +% fonts +\renewcommand{\rmdefault}{ptm} +\renewcommand{\sfdefault}{phv} + +% set page geometry +\usepackage[verbose=true,letterpaper]{geometry} +\AtBeginDocument{ + \newgeometry{ + textheight=9in, + textwidth=6.5in, + top=1in, + headheight=14pt, + headsep=25pt, + footskip=30pt + } +} + +\widowpenalty=10000 +\clubpenalty=10000 +\flushbottom +\sloppy + +\usepackage{fancyhdr} +\fancyhf{} +\pagestyle{fancy} +\renewcommand{\headrulewidth}{0pt} +\fancyheadoffset{0pt} +\rhead{\scshape A preprint - \today} +\cfoot{\thepage} + + +%Handling Keywords +\def\keywordname{{\bfseries \emph Keywords}}% +\def\keywords#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm +\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$ +}\noindent\keywordname\enspace\ignorespaces#1\par}} + +% font sizes with reduced leading +\renewcommand{\normalsize}{% + \@setfontsize\normalsize\@xpt\@xipt + \abovedisplayskip 7\p@ \@plus 2\p@ \@minus 5\p@ + \abovedisplayshortskip \z@ \@plus 3\p@ + \belowdisplayskip \abovedisplayskip + \belowdisplayshortskip 4\p@ \@plus 3\p@ \@minus 3\p@ +} +\normalsize +\renewcommand{\small}{% + \@setfontsize\small\@ixpt\@xpt + \abovedisplayskip 6\p@ \@plus 1.5\p@ \@minus 4\p@ + \abovedisplayshortskip \z@ \@plus 2\p@ + \belowdisplayskip \abovedisplayskip + \belowdisplayshortskip 3\p@ \@plus 2\p@ \@minus 2\p@ +} +\renewcommand{\footnotesize}{\@setfontsize\footnotesize\@ixpt\@xpt} +\renewcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt} +\renewcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt} +\renewcommand{\large}{\@setfontsize\large\@xiipt{14}} +\renewcommand{\Large}{\@setfontsize\Large\@xivpt{16}} +\renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{20}} +\renewcommand{\huge}{\@setfontsize\huge\@xxpt{23}} +\renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt{28}} + +% sections with less space +\providecommand{\section}{} +\renewcommand{\section}{% + \@startsection{section}{1}{\z@}% + {-2.0ex \@plus -0.5ex \@minus -0.2ex}% + { 1.5ex \@plus 0.3ex \@minus 0.2ex}% + {\large\bf\raggedright}% +} +\providecommand{\subsection}{} +\renewcommand{\subsection}{% + \@startsection{subsection}{2}{\z@}% + {-1.8ex \@plus -0.5ex \@minus -0.2ex}% + { 0.8ex \@plus 0.2ex}% + {\normalsize\bf\raggedright}% +} +\providecommand{\subsubsection}{} +\renewcommand{\subsubsection}{% + \@startsection{subsubsection}{3}{\z@}% + {-1.5ex \@plus -0.5ex \@minus -0.2ex}% + { 0.5ex \@plus 0.2ex}% + {\normalsize\bf\raggedright}% +} +\providecommand{\paragraph}{} +\renewcommand{\paragraph}{% + \@startsection{paragraph}{4}{\z@}% + {1.5ex \@plus 0.5ex \@minus 0.2ex}% + {-1em}% + {\normalsize\bf}% +} +\providecommand{\subparagraph}{} +\renewcommand{\subparagraph}{% + \@startsection{subparagraph}{5}{\z@}% + {1.5ex \@plus 0.5ex \@minus 0.2ex}% + {-1em}% + {\normalsize\bf}% +} +\providecommand{\subsubsubsection}{} +\renewcommand{\subsubsubsection}{% + \vskip5pt{\noindent\normalsize\rm\raggedright}% +} + +% float placement +\renewcommand{\topfraction }{0.85} +\renewcommand{\bottomfraction }{0.4} +\renewcommand{\textfraction }{0.1} +\renewcommand{\floatpagefraction}{0.7} + +\newlength{\@abovecaptionskip}\setlength{\@abovecaptionskip}{7\p@} +\newlength{\@belowcaptionskip}\setlength{\@belowcaptionskip}{\z@} + +\setlength{\abovecaptionskip}{\@abovecaptionskip} +\setlength{\belowcaptionskip}{\@belowcaptionskip} + +% swap above/belowcaptionskip lengths for tables +\renewenvironment{table} + {\setlength{\abovecaptionskip}{\@belowcaptionskip}% + \setlength{\belowcaptionskip}{\@abovecaptionskip}% + \@float{table}} + {\end@float} + +% footnote formatting +\setlength{\footnotesep }{6.65\p@} +\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@} +\renewcommand{\footnoterule}{\kern-3\p@ \hrule width 12pc \kern 2.6\p@} +\setcounter{footnote}{0} + +% paragraph formatting +\setlength{\parindent}{\z@} +\setlength{\parskip }{5.5\p@} + +% list formatting +\setlength{\topsep }{4\p@ \@plus 1\p@ \@minus 2\p@} +\setlength{\partopsep }{1\p@ \@plus 0.5\p@ \@minus 0.5\p@} +\setlength{\itemsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@} +\setlength{\parsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@} +\setlength{\leftmargin }{3pc} +\setlength{\leftmargini }{\leftmargin} +\setlength{\leftmarginii }{2em} +\setlength{\leftmarginiii}{1.5em} +\setlength{\leftmarginiv }{1.0em} +\setlength{\leftmarginv }{0.5em} +\def\@listi {\leftmargin\leftmargini} +\def\@listii {\leftmargin\leftmarginii + \labelwidth\leftmarginii + \advance\labelwidth-\labelsep + \topsep 2\p@ \@plus 1\p@ \@minus 0.5\p@ + \parsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@ + \itemsep \parsep} +\def\@listiii{\leftmargin\leftmarginiii + \labelwidth\leftmarginiii + \advance\labelwidth-\labelsep + \topsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@ + \parsep \z@ + \partopsep 0.5\p@ \@plus 0\p@ \@minus 0.5\p@ + \itemsep \topsep} +\def\@listiv {\leftmargin\leftmarginiv + \labelwidth\leftmarginiv + \advance\labelwidth-\labelsep} +\def\@listv {\leftmargin\leftmarginv + \labelwidth\leftmarginv + \advance\labelwidth-\labelsep} +\def\@listvi {\leftmargin\leftmarginvi + \labelwidth\leftmarginvi + \advance\labelwidth-\labelsep} + +% create title +\providecommand{\maketitle}{} +\renewcommand{\maketitle}{% + \par + \begingroup + \renewcommand{\thefootnote}{\fnsymbol{footnote}} + % for perfect author name centering + \renewcommand{\@makefnmark}{\hbox to \z@{$^{\@thefnmark}$\hss}} + % The footnote-mark was overlapping the footnote-text, + % added the following to fix this problem (MK) + \long\def\@makefntext##1{% + \parindent 1em\noindent + \hbox to 1.8em{\hss $\m@th ^{\@thefnmark}$}##1 + } + \thispagestyle{empty} + \@maketitle + \@thanks + %\@notice + \endgroup + \let\maketitle\relax + \let\thanks\relax +} + +% rules for title box at top of first page +\newcommand{\@toptitlebar}{ + \hrule height 2\p@ + \vskip 0.25in + \vskip -\parskip% +} +\newcommand{\@bottomtitlebar}{ + \vskip 0.29in + \vskip -\parskip + \hrule height 2\p@ + \vskip 0.09in% +} + +% create title (includes both anonymized and non-anonymized versions) +\providecommand{\@maketitle}{} +\renewcommand{\@maketitle}{% + \vbox{% + \hsize\textwidth + \linewidth\hsize + \vskip 0.1in + \@toptitlebar + \centering + {\LARGE\sc \@title\par} + \@bottomtitlebar + \textsc{}\\ + \vskip 0.1in + \def\And{% + \end{tabular}\hfil\linebreak[0]\hfil% + \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces% + } + \def\AND{% + \end{tabular}\hfil\linebreak[4]\hfil% + \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces% + } + \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\@author\end{tabular}% + \vskip 0.4in \@minus 0.1in \center{} \vskip 0.2in + } +} + +% add conference notice to bottom of first page +\newcommand{\ftype@noticebox}{8} +\newcommand{\@notice}{% + % give a bit of extra room back to authors on first page + \enlargethispage{2\baselineskip}% + \@float{noticebox}[b]% + \footnotesize\@noticestring% + \end@float% +} + +% abstract styling +\renewenvironment{abstract} +{ + \centerline + {\large \bfseries \scshape Abstract} + \begin{quote} +} +{ + \end{quote} +} + +\endinput diff --git a/source_current/boundary_5_0.01.pdf b/source_current/boundary_5_0.01.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d6a56e6dca99741542a81fb4ada9a9564d84f2eb Binary files /dev/null and b/source_current/boundary_5_0.01.pdf differ diff --git a/source_current/circle_boundary_comparison.pdf b/source_current/circle_boundary_comparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..48474e5a34ac101042c95c1b14134bfc7209fcea Binary files /dev/null and b/source_current/circle_boundary_comparison.pdf differ diff --git a/source_current/exp_convergence.pdf b/source_current/exp_convergence.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9551570f50f7f4ac69cb9bb753db0ffcca600c13 --- /dev/null +++ b/source_current/exp_convergence.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de4a873a0320d50e2635aecc5202fbece17ce4fe1296149fa76c007908ade633 +size 973170 diff --git a/source_current/exp_epsilon.pdf b/source_current/exp_epsilon.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dd10d2bc120fcf545ba4f32e57a7293e95a995ab --- /dev/null +++ b/source_current/exp_epsilon.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bc60518357260750e769f10a02ee935e90c7f18f16797b0337f8dc87f6aa972 +size 2005646 diff --git a/source_current/exp_lr.pdf b/source_current/exp_lr.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3888d2d9f1ef7d54b3e39d6cc8f6945fb4ccd649 --- /dev/null +++ b/source_current/exp_lr.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3bc6b3adad7aa3d062799b9bf89ba10ac0d0f77e95058d432f0b9d24dc553b2 +size 806715 diff --git a/source_current/exp_num_samples.pdf b/source_current/exp_num_samples.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1c55099b71ef2377fc19f5257a194207332e8953 --- /dev/null +++ b/source_current/exp_num_samples.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9a3f86d38902255ba2cf9d62464cf511dac61f49a34d60086041625e4f2b462 +size 807231 diff --git a/source_current/exp_tau.pdf b/source_current/exp_tau.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1cd2e04b8b140043ea5306b3fa62e2277c153be7 --- /dev/null +++ b/source_current/exp_tau.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:210a06b8ade1ff37ecba8bf56cfd96fb6bb1b2febdfdc84ac59e7c25a8f5a66a +size 796445 diff --git a/source_current/fancyhdr.sty b/source_current/fancyhdr.sty new file mode 100644 index 0000000000000000000000000000000000000000..77ed4e3012d822c7cca5c17efcae308b32b8cc2b --- /dev/null +++ b/source_current/fancyhdr.sty @@ -0,0 +1,485 @@ +% fancyhdr.sty version 3.2 +% Fancy headers and footers for LaTeX. +% Piet van Oostrum, +% Dept of Computer and Information Sciences, University of Utrecht, +% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands +% Telephone: +31 30 2532180. Email: piet@cs.uu.nl +% ======================================================================== +% LICENCE: +% This file may be distributed under the terms of the LaTeX Project Public +% License, as described in lppl.txt in the base LaTeX distribution. +% Either version 1 or, at your option, any later version. +% ======================================================================== +% MODIFICATION HISTORY: +% Sep 16, 1994 +% version 1.4: Correction for use with \reversemargin +% Sep 29, 1994: +% version 1.5: Added the \iftopfloat, \ifbotfloat and \iffloatpage commands +% Oct 4, 1994: +% version 1.6: Reset single spacing in headers/footers for use with +% setspace.sty or doublespace.sty +% Oct 4, 1994: +% version 1.7: changed \let\@mkboth\markboth to +% \def\@mkboth{\protect\markboth} to make it more robust +% Dec 5, 1994: +% version 1.8: corrections for amsbook/amsart: define \@chapapp and (more +% importantly) use the \chapter/sectionmark definitions from ps@headings if +% they exist (which should be true for all standard classes). +% May 31, 1995: +% version 1.9: The proposed \renewcommand{\headrulewidth}{\iffloatpage... +% construction in the doc did not work properly with the fancyplain style. +% June 1, 1995: +% version 1.91: The definition of \@mkboth wasn't restored on subsequent +% \pagestyle{fancy}'s. +% June 1, 1995: +% version 1.92: The sequence \pagestyle{fancyplain} \pagestyle{plain} +% \pagestyle{fancy} would erroneously select the plain version. +% June 1, 1995: +% version 1.93: \fancypagestyle command added. +% Dec 11, 1995: +% version 1.94: suggested by Conrad Hughes +% CJCH, Dec 11, 1995: added \footruleskip to allow control over footrule +% position (old hardcoded value of .3\normalbaselineskip is far too high +% when used with very small footer fonts). +% Jan 31, 1996: +% version 1.95: call \@normalsize in the reset code if that is defined, +% otherwise \normalsize. +% this is to solve a problem with ucthesis.cls, as this doesn't +% define \@currsize. Unfortunately for latex209 calling \normalsize doesn't +% work as this is optimized to do very little, so there \@normalsize should +% be called. Hopefully this code works for all versions of LaTeX known to +% mankind. +% April 25, 1996: +% version 1.96: initialize \headwidth to a magic (negative) value to catch +% most common cases that people change it before calling \pagestyle{fancy}. +% Note it can't be initialized when reading in this file, because +% \textwidth could be changed afterwards. This is quite probable. +% We also switch to \MakeUppercase rather than \uppercase and introduce a +% \nouppercase command for use in headers. and footers. +% May 3, 1996: +% version 1.97: Two changes: +% 1. Undo the change in version 1.8 (using the pagestyle{headings} defaults +% for the chapter and section marks. The current version of amsbook and +% amsart classes don't seem to need them anymore. Moreover the standard +% latex classes don't use \markboth if twoside isn't selected, and this is +% confusing as \leftmark doesn't work as expected. +% 2. include a call to \ps@empty in ps@@fancy. This is to solve a problem +% in the amsbook and amsart classes, that make global changes to \topskip, +% which are reset in \ps@empty. Hopefully this doesn't break other things. +% May 7, 1996: +% version 1.98: +% Added % after the line \def\nouppercase +% May 7, 1996: +% version 1.99: This is the alpha version of fancyhdr 2.0 +% Introduced the new commands \fancyhead, \fancyfoot, and \fancyhf. +% Changed \headrulewidth, \footrulewidth, \footruleskip to +% macros rather than length parameters, In this way they can be +% conditionalized and they don't consume length registers. There is no need +% to have them as length registers unless you want to do calculations with +% them, which is unlikely. Note that this may make some uses of them +% incompatible (i.e. if you have a file that uses \setlength or \xxxx=) +% May 10, 1996: +% version 1.99a: +% Added a few more % signs +% May 10, 1996: +% version 1.99b: +% Changed the syntax of \f@nfor to be resistent to catcode changes of := +% Removed the [1] from the defs of \lhead etc. because the parameter is +% consumed by the \@[xy]lhead etc. macros. +% June 24, 1997: +% version 1.99c: +% corrected \nouppercase to also include the protected form of \MakeUppercase +% \global added to manipulation of \headwidth. +% \iffootnote command added. +% Some comments added about \@fancyhead and \@fancyfoot. +% Aug 24, 1998 +% version 1.99d +% Changed the default \ps@empty to \ps@@empty in order to allow +% \fancypagestyle{empty} redefinition. +% Oct 11, 2000 +% version 2.0 +% Added LPPL license clause. +% +% A check for \headheight is added. An errormessage is given (once) if the +% header is too large. Empty headers don't generate the error even if +% \headheight is very small or even 0pt. +% Warning added for the use of 'E' option when twoside option is not used. +% In this case the 'E' fields will never be used. +% +% Mar 10, 2002 +% version 2.1beta +% New command: \fancyhfoffset[place]{length} +% defines offsets to be applied to the header/footer to let it stick into +% the margins (if length > 0). +% place is like in fancyhead, except that only E,O,L,R can be used. +% This replaces the old calculation based on \headwidth and the marginpar +% area. +% \headwidth will be dynamically calculated in the headers/footers when +% this is used. +% +% Mar 26, 2002 +% version 2.1beta2 +% \fancyhfoffset now also takes h,f as possible letters in the argument to +% allow the header and footer widths to be different. +% New commands \fancyheadoffset and \fancyfootoffset added comparable to +% \fancyhead and \fancyfoot. +% Errormessages and warnings have been made more informative. +% +% Dec 9, 2002 +% version 2.1 +% The defaults for \footrulewidth, \plainheadrulewidth and +% \plainfootrulewidth are changed from \z@skip to 0pt. In this way when +% someone inadvertantly uses \setlength to change any of these, the value +% of \z@skip will not be changed, rather an errormessage will be given. + +% March 3, 2004 +% Release of version 3.0 + +% Oct 7, 2004 +% version 3.1 +% Added '\endlinechar=13' to \fancy@reset to prevent problems with +% includegraphics in header when verbatiminput is active. + +% March 22, 2005 +% version 3.2 +% reset \everypar (the real one) in \fancy@reset because spanish.ldf does +% strange things with \everypar between << and >>. + +\def\ifancy@mpty#1{\def\temp@a{#1}\ifx\temp@a\@empty} + +\def\fancy@def#1#2{\ifancy@mpty{#2}\fancy@gbl\def#1{\leavevmode}\else + \fancy@gbl\def#1{#2\strut}\fi} + +\let\fancy@gbl\global + +\def\@fancyerrmsg#1{% + \ifx\PackageError\undefined + \errmessage{#1}\else + \PackageError{Fancyhdr}{#1}{}\fi} +\def\@fancywarning#1{% + \ifx\PackageWarning\undefined + \errmessage{#1}\else + \PackageWarning{Fancyhdr}{#1}{}\fi} + +% Usage: \@forc \var{charstring}{command to be executed for each char} +% This is similar to LaTeX's \@tfor, but expands the charstring. + +\def\@forc#1#2#3{\expandafter\f@rc\expandafter#1\expandafter{#2}{#3}} +\def\f@rc#1#2#3{\def\temp@ty{#2}\ifx\@empty\temp@ty\else + \f@@rc#1#2\f@@rc{#3}\fi} +\def\f@@rc#1#2#3\f@@rc#4{\def#1{#2}#4\f@rc#1{#3}{#4}} + +% Usage: \f@nfor\name:=list\do{body} +% Like LaTeX's \@for but an empty list is treated as a list with an empty +% element + +\newcommand{\f@nfor}[3]{\edef\@fortmp{#2}% + \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}} + +% Usage: \def@ult \cs{defaults}{argument} +% sets \cs to the characters from defaults appearing in argument +% or defaults if it would be empty. All characters are lowercased. + +\newcommand\def@ult[3]{% + \edef\temp@a{\lowercase{\edef\noexpand\temp@a{#3}}}\temp@a + \def#1{}% + \@forc\tmpf@ra{#2}% + {\expandafter\if@in\tmpf@ra\temp@a{\edef#1{#1\tmpf@ra}}{}}% + \ifx\@empty#1\def#1{#2}\fi} +% +% \if@in +% +\newcommand{\if@in}[4]{% + \edef\temp@a{#2}\def\temp@b##1#1##2\temp@b{\def\temp@b{##1}}% + \expandafter\temp@b#2#1\temp@b\ifx\temp@a\temp@b #4\else #3\fi} + +\newcommand{\fancyhead}{\@ifnextchar[{\f@ncyhf\fancyhead h}% + {\f@ncyhf\fancyhead h[]}} +\newcommand{\fancyfoot}{\@ifnextchar[{\f@ncyhf\fancyfoot f}% + {\f@ncyhf\fancyfoot f[]}} +\newcommand{\fancyhf}{\@ifnextchar[{\f@ncyhf\fancyhf{}}% + {\f@ncyhf\fancyhf{}[]}} + +% New commands for offsets added + +\newcommand{\fancyheadoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyheadoffset h}% + {\f@ncyhfoffs\fancyheadoffset h[]}} +\newcommand{\fancyfootoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyfootoffset f}% + {\f@ncyhfoffs\fancyfootoffset f[]}} +\newcommand{\fancyhfoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyhfoffset{}}% + {\f@ncyhfoffs\fancyhfoffset{}[]}} + +% The header and footer fields are stored in command sequences with +% names of the form: \f@ncy with for [eo], from [lcr] +% and from [hf]. + +\def\f@ncyhf#1#2[#3]#4{% + \def\temp@c{}% + \@forc\tmpf@ra{#3}% + {\expandafter\if@in\tmpf@ra{eolcrhf,EOLCRHF}% + {}{\edef\temp@c{\temp@c\tmpf@ra}}}% + \ifx\@empty\temp@c\else + \@fancyerrmsg{Illegal char `\temp@c' in \string#1 argument: + [#3]}% + \fi + \f@nfor\temp@c{#3}% + {\def@ult\f@@@eo{eo}\temp@c + \if@twoside\else + \if\f@@@eo e\@fancywarning + {\string#1's `E' option without twoside option is useless}\fi\fi + \def@ult\f@@@lcr{lcr}\temp@c + \def@ult\f@@@hf{hf}{#2\temp@c}% + \@forc\f@@eo\f@@@eo + {\@forc\f@@lcr\f@@@lcr + {\@forc\f@@hf\f@@@hf + {\expandafter\fancy@def\csname + f@ncy\f@@eo\f@@lcr\f@@hf\endcsname + {#4}}}}}} + +\def\f@ncyhfoffs#1#2[#3]#4{% + \def\temp@c{}% + \@forc\tmpf@ra{#3}% + {\expandafter\if@in\tmpf@ra{eolrhf,EOLRHF}% + {}{\edef\temp@c{\temp@c\tmpf@ra}}}% + \ifx\@empty\temp@c\else + \@fancyerrmsg{Illegal char `\temp@c' in \string#1 argument: + [#3]}% + \fi + \f@nfor\temp@c{#3}% + {\def@ult\f@@@eo{eo}\temp@c + \if@twoside\else + \if\f@@@eo e\@fancywarning + {\string#1's `E' option without twoside option is useless}\fi\fi + \def@ult\f@@@lcr{lr}\temp@c + \def@ult\f@@@hf{hf}{#2\temp@c}% + \@forc\f@@eo\f@@@eo + {\@forc\f@@lcr\f@@@lcr + {\@forc\f@@hf\f@@@hf + {\expandafter\setlength\csname + f@ncyO@\f@@eo\f@@lcr\f@@hf\endcsname + {#4}}}}}% + \fancy@setoffs} + +% Fancyheadings version 1 commands. These are more or less deprecated, +% but they continue to work. + +\newcommand{\lhead}{\@ifnextchar[{\@xlhead}{\@ylhead}} +\def\@xlhead[#1]#2{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#2}} +\def\@ylhead#1{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#1}} + +\newcommand{\chead}{\@ifnextchar[{\@xchead}{\@ychead}} +\def\@xchead[#1]#2{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#2}} +\def\@ychead#1{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#1}} + +\newcommand{\rhead}{\@ifnextchar[{\@xrhead}{\@yrhead}} +\def\@xrhead[#1]#2{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#2}} +\def\@yrhead#1{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#1}} + +\newcommand{\lfoot}{\@ifnextchar[{\@xlfoot}{\@ylfoot}} +\def\@xlfoot[#1]#2{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#2}} +\def\@ylfoot#1{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#1}} + +\newcommand{\cfoot}{\@ifnextchar[{\@xcfoot}{\@ycfoot}} +\def\@xcfoot[#1]#2{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#2}} +\def\@ycfoot#1{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#1}} + +\newcommand{\rfoot}{\@ifnextchar[{\@xrfoot}{\@yrfoot}} +\def\@xrfoot[#1]#2{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#2}} +\def\@yrfoot#1{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#1}} + +\newlength{\fancy@headwidth} +\let\headwidth\fancy@headwidth +\newlength{\f@ncyO@elh} +\newlength{\f@ncyO@erh} +\newlength{\f@ncyO@olh} +\newlength{\f@ncyO@orh} +\newlength{\f@ncyO@elf} +\newlength{\f@ncyO@erf} +\newlength{\f@ncyO@olf} +\newlength{\f@ncyO@orf} +\newcommand{\headrulewidth}{0.4pt} +\newcommand{\footrulewidth}{0pt} +\newcommand{\footruleskip}{.3\normalbaselineskip} + +% Fancyplain stuff shouldn't be used anymore (rather +% \fancypagestyle{plain} should be used), but it must be present for +% compatibility reasons. + +\newcommand{\plainheadrulewidth}{0pt} +\newcommand{\plainfootrulewidth}{0pt} +\newif\if@fancyplain \@fancyplainfalse +\def\fancyplain#1#2{\if@fancyplain#1\else#2\fi} + +\headwidth=-123456789sp %magic constant + +% Command to reset various things in the headers: +% a.o. single spacing (taken from setspace.sty) +% and the catcode of ^^M (so that epsf files in the header work if a +% verbatim crosses a page boundary) +% It also defines a \nouppercase command that disables \uppercase and +% \Makeuppercase. It can only be used in the headers and footers. +\let\fnch@everypar\everypar% save real \everypar because of spanish.ldf +\def\fancy@reset{\fnch@everypar{}\restorecr\endlinechar=13 + \def\baselinestretch{1}% + \def\nouppercase##1{{\let\uppercase\relax\let\MakeUppercase\relax + \expandafter\let\csname MakeUppercase \endcsname\relax##1}}% + \ifx\undefined\@newbaseline% NFSS not present; 2.09 or 2e + \ifx\@normalsize\undefined \normalsize % for ucthesis.cls + \else \@normalsize \fi + \else% NFSS (2.09) present + \@newbaseline% + \fi} + +% Initialization of the head and foot text. + +% The default values still contain \fancyplain for compatibility. +\fancyhf{} % clear all +% lefthead empty on ``plain'' pages, \rightmark on even, \leftmark on odd pages +% evenhead empty on ``plain'' pages, \leftmark on even, \rightmark on odd pages +\if@twoside + \fancyhead[el,or]{\fancyplain{}{\sl\rightmark}} + \fancyhead[er,ol]{\fancyplain{}{\sl\leftmark}} +\else + \fancyhead[l]{\fancyplain{}{\sl\rightmark}} + \fancyhead[r]{\fancyplain{}{\sl\leftmark}} +\fi +\fancyfoot[c]{\rm\thepage} % page number + +% Use box 0 as a temp box and dimen 0 as temp dimen. +% This can be done, because this code will always +% be used inside another box, and therefore the changes are local. + +\def\@fancyvbox#1#2{\setbox0\vbox{#2}\ifdim\ht0>#1\@fancywarning + {\string#1 is too small (\the#1): ^^J Make it at least \the\ht0.^^J + We now make it that large for the rest of the document.^^J + This may cause the page layout to be inconsistent, however\@gobble}% + \dimen0=#1\global\setlength{#1}{\ht0}\ht0=\dimen0\fi + \box0} + +% Put together a header or footer given the left, center and +% right text, fillers at left and right and a rule. +% The \lap commands put the text into an hbox of zero size, +% so overlapping text does not generate an errormessage. +% These macros have 5 parameters: +% 1. LEFTSIDE BEARING % This determines at which side the header will stick +% out. When \fancyhfoffset is used this calculates \headwidth, otherwise +% it is \hss or \relax (after expansion). +% 2. \f@ncyolh, \f@ncyelh, \f@ncyolf or \f@ncyelf. This is the left component. +% 3. \f@ncyoch, \f@ncyech, \f@ncyocf or \f@ncyecf. This is the middle comp. +% 4. \f@ncyorh, \f@ncyerh, \f@ncyorf or \f@ncyerf. This is the right component. +% 5. RIGHTSIDE BEARING. This is always \relax or \hss (after expansion). + +\def\@fancyhead#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset + \@fancyvbox\headheight{\hbox + {\rlap{\parbox[b]{\headwidth}{\raggedright#2}}\hfill + \parbox[b]{\headwidth}{\centering#3}\hfill + \llap{\parbox[b]{\headwidth}{\raggedleft#4}}}\headrule}}#5} + +\def\@fancyfoot#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset + \@fancyvbox\footskip{\footrule + \hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2}}\hfill + \parbox[t]{\headwidth}{\centering#3}\hfill + \llap{\parbox[t]{\headwidth}{\raggedleft#4}}}}}#5} + +\def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi + \hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}} + +\def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi + \vskip-\footruleskip\vskip-\footrulewidth + \hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}} + +\def\ps@fancy{% +\@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook +% +% Define \MakeUppercase for old LaTeXen. +% Note: we used \def rather than \let, so that \let\uppercase\relax (from +% the version 1 documentation) will still work. +% +\@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}% +\@ifundefined{chapter}{\def\sectionmark##1{\markboth +{\MakeUppercase{\ifnum \c@secnumdepth>\z@ + \thesection\hskip 1em\relax \fi ##1}}{}}% +\def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne + \thesubsection\hskip 1em\relax \fi ##1}}}% +{\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\m@ne + \@chapapp\ \thechapter. \ \fi ##1}}{}}% +\def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@ + \thesection. \ \fi ##1}}}}% +%\csname ps@headings\endcsname % use \ps@headings defaults if they exist +\ps@@fancy +\gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}% +% Initialize \headwidth if the user didn't +% +\ifdim\headwidth<0sp +% +% This catches the case that \headwidth hasn't been initialized and the +% case that the user added something to \headwidth in the expectation that +% it was initialized to \textwidth. We compensate this now. This loses if +% the user intended to multiply it by a factor. But that case is more +% likely done by saying something like \headwidth=1.2\textwidth. +% The doc says you have to change \headwidth after the first call to +% \pagestyle{fancy}. This code is just to catch the most common cases were +% that requirement is violated. +% + \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth +\fi} +\def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy} +\def\ps@plain@fancy{\@fancyplaintrue\ps@@fancy} +\let\ps@@empty\ps@empty +\def\ps@@fancy{% +\ps@@empty % This is for amsbook/amsart, which do strange things with \topskip +\def\@mkboth{\protect\markboth}% +\def\@oddhead{\@fancyhead\fancy@Oolh\f@ncyolh\f@ncyoch\f@ncyorh\fancy@Oorh}% +\def\@oddfoot{\@fancyfoot\fancy@Oolf\f@ncyolf\f@ncyocf\f@ncyorf\fancy@Oorf}% +\def\@evenhead{\@fancyhead\fancy@Oelh\f@ncyelh\f@ncyech\f@ncyerh\fancy@Oerh}% +\def\@evenfoot{\@fancyfoot\fancy@Oelf\f@ncyelf\f@ncyecf\f@ncyerf\fancy@Oerf}% +} +% Default definitions for compatibility mode: +% These cause the header/footer to take the defined \headwidth as width +% And to shift in the direction of the marginpar area + +\def\fancy@Oolh{\if@reversemargin\hss\else\relax\fi} +\def\fancy@Oorh{\if@reversemargin\relax\else\hss\fi} +\let\fancy@Oelh\fancy@Oorh +\let\fancy@Oerh\fancy@Oolh + +\let\fancy@Oolf\fancy@Oolh +\let\fancy@Oorf\fancy@Oorh +\let\fancy@Oelf\fancy@Oelh +\let\fancy@Oerf\fancy@Oerh + +% New definitions for the use of \fancyhfoffset +% These calculate the \headwidth from \textwidth and the specified offsets. + +\def\fancy@offsolh{\headwidth=\textwidth\advance\headwidth\f@ncyO@olh + \advance\headwidth\f@ncyO@orh\hskip-\f@ncyO@olh} +\def\fancy@offselh{\headwidth=\textwidth\advance\headwidth\f@ncyO@elh + \advance\headwidth\f@ncyO@erh\hskip-\f@ncyO@elh} + +\def\fancy@offsolf{\headwidth=\textwidth\advance\headwidth\f@ncyO@olf + \advance\headwidth\f@ncyO@orf\hskip-\f@ncyO@olf} +\def\fancy@offself{\headwidth=\textwidth\advance\headwidth\f@ncyO@elf + \advance\headwidth\f@ncyO@erf\hskip-\f@ncyO@elf} + +\def\fancy@setoffs{% +% Just in case \let\headwidth\textwidth was used + \fancy@gbl\let\headwidth\fancy@headwidth + \fancy@gbl\let\fancy@Oolh\fancy@offsolh + \fancy@gbl\let\fancy@Oelh\fancy@offselh + \fancy@gbl\let\fancy@Oorh\hss + \fancy@gbl\let\fancy@Oerh\hss + \fancy@gbl\let\fancy@Oolf\fancy@offsolf + \fancy@gbl\let\fancy@Oelf\fancy@offself + \fancy@gbl\let\fancy@Oorf\hss + \fancy@gbl\let\fancy@Oerf\hss} + +\newif\iffootnote +\let\latex@makecol\@makecol +\def\@makecol{\ifvoid\footins\footnotetrue\else\footnotefalse\fi +\let\topfloat\@toplist\let\botfloat\@botlist\latex@makecol} +\def\iftopfloat#1#2{\ifx\topfloat\empty #2\else #1\fi} +\def\ifbotfloat#1#2{\ifx\botfloat\empty #2\else #1\fi} +\def\iffloatpage#1#2{\if@fcolmade #1\else #2\fi} + +\newcommand{\fancypagestyle}[2]{% + \@namedef{ps@#1}{\let\fancy@gbl\relax#2\relax\ps@fancy}} diff --git a/source_current/frame_020.pdf b/source_current/frame_020.pdf new file mode 100644 index 0000000000000000000000000000000000000000..48f2461304d82e1c1ef62029ebef342021aea1f3 --- /dev/null +++ b/source_current/frame_020.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e3af5d048af03dbf2ee22560590d19dae055c7ec68a6bd4c710bdebe32390d8 +size 318534 diff --git a/source_current/frame_100.pdf b/source_current/frame_100.pdf new file mode 100644 index 0000000000000000000000000000000000000000..87bb3da6afdec8e0923c740c6baa147458190819 --- /dev/null +++ b/source_current/frame_100.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d33e3ee01f8df8e37d3cda6a806c5574b4e1d97e956efedb87e728429169173c +size 319738 diff --git a/source_current/frame_288.pdf b/source_current/frame_288.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e149d3d62ceffef8fa0ac4e8d495920d53f05473 --- /dev/null +++ b/source_current/frame_288.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d19fcf87c2ff1af69accaeb6b2b6b699a2ae72fce656f42576275e1a4d3b034 +size 319642 diff --git a/source_current/loss_curves.pdf b/source_current/loss_curves.pdf new file mode 100644 index 0000000000000000000000000000000000000000..67581840959b6f4346968cf9597896ebeea104a3 Binary files /dev/null and b/source_current/loss_curves.pdf differ diff --git a/source_current/main.tex b/source_current/main.tex new file mode 100644 index 0000000000000000000000000000000000000000..2f9f79247a94a32cfb0dc53e49b75b46f203b412 --- /dev/null +++ b/source_current/main.tex @@ -0,0 +1,1797 @@ +\documentclass{article} + +\usepackage{microtype} +\usepackage{graphicx} +\usepackage{subcaption} +\usepackage{booktabs} +\usepackage{arxiv} + + +\usepackage{mathtools} +\usepackage{amsthm} +\usepackage{natbib} +\usepackage[english]{babel} +\usepackage[utf8]{inputenc} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{float} +\usepackage{booktabs} +\usepackage{multirow} +\usepackage{graphicx} +\usepackage{subcaption} +\usepackage[colorinlistoftodos]{todonotes} +\usepackage{algorithm} +\usepackage{algorithmic} +\usepackage{pgfplots} +\pgfplotsset{compat=1.12} +\usepackage{mwe} +\usepackage{hyperref} +\usepackage{tikz} +\usetikzlibrary{shapes.geometric, arrows, positioning, calc, backgrounds, fit} + + +\newcommand{\Qrob}{\mathbb{Q}} +\newcommand{\calP}{\mathcal{P}} +\newcommand{\calM}{\mathcal{M}} +\newcommand{\calZ}{\mathcal{Z}} +\newcommand{\calB}{\mathcal{B}} +\newcommand{\W}{\mathbb{W}} +\newcommand{\X}{\mathcal{X}} +\newcommand{\calK}{\mathcal{K}} +\newcommand{\esssup}{\operatornamewithlimits{ess\,sup}} +\newcommand{\norm}[1]{\left\lVert#1\right\rVert} + +\usepackage[capitalize,noabbrev]{cleveref} + +\theoremstyle{plain} +\newtheorem{theorem}{Theorem}[section] +\newtheorem{proposition}[theorem]{Proposition} +\newtheorem{lemma}[theorem]{Lemma} +\newtheorem{corollary}[theorem]{Corollary} +\theoremstyle{definition} +\newtheorem{definition}[theorem]{Definition} +\newtheorem{assumption}[theorem]{Assumption} +\theoremstyle{remark} +\newtheorem{remark}[theorem]{Remark} + + + +\usepackage{preamble-JZ} + +\title{Gradient Flow Sampler-based\\ +Distributionally Robust Optimization} + +\author{ +Zusen Xu\\ +Weierstrass Institute \& \\ +KTH Royal Institute of Technology\\ +Berlin, Germany\\ +\texttt{zusen.xu@wias-berlin.de} \\ + \And +Jia-Jie Zhu\\ +Weierstrass Institute \& \\ +KTH Royal Institute of Technology\\ +Stockholm, Sweden\\ +\texttt{jiajie@kth.se}\\ +} + +\begin{document} + +\maketitle + +\begin{abstract} +We propose a mathematically principled PDE gradient flow framework for distributionally robust optimization (DRO). Exploiting the recent advances in the intersection of Monte Carlo sampling and statistical optimal transport, we show that our theoretical framework can be implemented as practical algorithms for sampling from worst-case distributions and, consequently, DRO. +While numerous previous works have relied on dual reformulation techniques, we contribute a sound and complete gradient flow view based on SDEs or PDEs that can be used to construct new algorithms for general, potentially non-convex, losses. + As an application, we solve a class of Wasserstein and entropy-regularized DRO problems using the recently-discovered Wasserstein Fisher-Rao and Stein variational gradient flows. Notably, we also show some simple reductions of our framework recover exactly previously proposed popular DRO methods, and provide new insights into their theoretical limits and optimization dynamics of DRO. Numerical studies based on stochastic gradient descent on machine learning tasks provide empirical backing for our theoretical findings. + +\end{abstract} + + + +\section{Introduction}\label{sec:intro} + +Distributionally robust optimization (DRO)~\citep{delageDistributionallyRobustOptimization2010,kuhnDistributionallyRobustOptimization2024} +is a framework that aims to enhance the robustness of the solution to optimization problems. + After the original Wasserstein distributionally robust optimization (DRO) works \citep{mohajerin2018data,zhaoDatadrivenRiskaverseStochastic2018,gaoDistributionallyRobustStochastic2016}, many subsequent works have presented variations of problems with various numerical solutions. + In particular, Sinkhorn DRO \citep{wang2021sinkhorn}, also referred to as entropy-regularized Wasserstein DRO \citep{dapogny2023entropy}, demonstrates significant advantages in handling tasks with class imbalance. The entropy-regularized Wasserstein DRO problem can be formulated as a penalized optimization problem: +\begin{align} + \min_{\theta\in\Theta} \max_{\rho\in\calP} + \left\{ \int \ell(\theta, y)\dd\rho{(y)} - \tfrac1{2\tau} W^2_{\epsilon}(\rho,\widehat{\rho_N}) \right\} + \label{eq:main-ent-dro} +\end{align} +where $\tau > 0$ is the regularization parameter, $\widehat{\rho_N}$ is an empirical dataset, and $W^2_{\epsilon}(\mu, \nu) := \inf_{\gamma\in \Pi(\mu,\nu)} \{\mathbb{E}_{\gamma}[c] + \epsilon H(\gamma)\}$ is the +entropy-regularized optimal transport (OT) divergence. Here, $\Pi(\mu,\nu)$ is the set of couplings with marginals $\mu$ and $\nu$, $c: \mathbb R^d \times \mathbb R^d \rightarrow \mathbb R$ is a cost function, $H(\gamma) = \int \gamma \log \gamma$ is the negative entropy, and $\epsilon > 0$ is the entropy regularization parameter. +If we set $\epsilon = 0 $, we recover the penalized version of the Wasserstein DRO as considered by \citet{sinha2020certifyingdistributionalrobustnessprincipled}. +Without loss of generality, we will temporarily focus on the interesting choice of $W^2_\epsilon$, while other choices such as the KL divergences can also be straightforwardly adapted to our framework. + + +We observe that the inner maximization problem in \eqref{eq:main-ent-dro} is equivalent to applying the entropy-regularized JKO operator (detailed in \eqref{eq:proximal-EOT}) from the PDE literature\citep{jordan1998variational, peyre2015entropic} , resulting the equivalent formulation to \eqref{eq:main-ent-dro} +\begin{align} +\min_{\theta\in\Theta} +\bbE _ {y\sim \pi_Y} \ell (\theta, y), +\quad +\pi_Y = \epsjko_{\tau V}(\widehat{\rho_N}) +\label{eq:ent-jko-reformulation} +\end{align} + where $V:=-\ell$. Exploiting this connection, our key insight is solving the inner problem of DRO \eqref{eq:main-ent-dro} can be achieved by sampling from the worst-case distribution $\pi_Y$ using a gradient flow. +This simplification of the problem structure provides intuition for novel algorithmic design, which we use to effortlessly obtain novel algorithms such as Wasserstein-Fisher-Rao and Stein variational gradient-based DRO algorithms. +We term our methodology +\emph{Gradient Flow Sampler-based Distributionally Robust Optimization} (GF-DRO). +We illustrate the main idea in Figure~\ref{fig:gf-dro-intro}. + + +\begin{figure}[h!] + \centering + \tikzset{ + block/.style={rectangle, draw=black, minimum width=2.0cm, minimum height=0.6cm, text centered, font=\tiny\sffamily, line width=0.4pt}, + img_node/.style={rectangle, draw=black!30, inner sep=0pt, line width=0.4pt}, + arrow/.style={thick, ->, >=stealth, line width=0.6pt}, + label_style/.style={font=\tiny\itshape\sffamily, align=center}, + container/.style={draw=black!15, rectangle, rounded corners=2pt, inner sep=0.15cm, line width=0.4pt} + } + + \begin{tikzpicture}[node distance=0.8cm] + \node (data_node) [block, fill=blue!5] {$X \sim \widehat{\rho_N}$}; + + \node (fig1_node) [img_node, below=0.1cm of data_node] { + \includegraphics[width=1.6cm]{original.pdf} + }; + + \begin{scope}[on background layer] + \node (input_box) [container, fill=blue!2, fit=(data_node) (fig1_node)] {}; + \node[above=0pt of input_box, font=\tiny\bfseries\sffamily] {A sample from dataset}; + \end{scope} + + \node (fig_perturbed) [img_node, right=2.4cm of data_node] { + \includegraphics[width=3.0cm]{perturbed_top3.pdf} + }; + + \node (worst_case_node) [block, below=0.3cm of fig_perturbed, fill=red!5] {$Y_i \sim \pi_{Y|X}$}; + + \begin{scope}[on background layer] + \node (output_box) [container, fill=red!2, fit=(fig_perturbed) (worst_case_node)] {}; + \node[above=0pt of output_box, font=\tiny\bfseries\sffamily, align=center] {Samples from conditional \\ worst-case distribution}; + \end{scope} + + \node (update_node) [block, below=1.2cm of output_box.south, xshift=-1.5cm, minimum width=3.8cm, fill=green!5] { + \begin{tabular}{c} + \textbf{Parameter Update} \\ + $\theta \leftarrow \text{Proj}_\Theta(\theta - r \hat{g})$ + \end{tabular} + }; + + \draw [arrow] (input_box.east) -- node[above, label_style] {Gradient Flow \\ Samplers} (output_box.west |- input_box.east); + + \draw [arrow] (worst_case_node.south) -- node[right, label_style, xshift=0.05cm] {Estimate \\ gradient $\hat{g}$} (update_node.north -| worst_case_node.south); + + \draw [arrow, dashed, draw=black!30] (update_node.west) -| (input_box.south) + node[pos=0.3, above, yshift=0.05cm, label_style, color=black!40] {Next Iteration}; + + \end{tikzpicture} + \caption{\textbf{GF-DRO} generates samples from the conditional worst-case distribution along the evolution of S/PDE gradient flows, which is fundamentally different from previous DRO methods. Here $\pi_{Y|X}$ denotes the conditional worst-case distribution defined by the entropic JKO operator (see Proposition~\ref{lem:sb-klform}). See text for detailed explanation and Section~\ref{sec:experiments} for numerical experiments.} + \label{fig:gf-dro-intro} + \vspace{-0.4cm} +\end{figure} + +To obtain theoretical guarantees, we connect the stochastic approximation of the gradient w.r.t. $\theta$ for the outer DRO problem + $\widehat g = +\nabla_\theta \ell (\theta, y), \, y\sim \pi_Y$, +with the analysis of gradient flow-based samplers. +Subsequently, the gradient estimate is used for the outer DRO problem via SGD-like updates, e.g., $\theta^{s+1} \gets \theta^s - \eta \widehat g$. +The bound of $\widehat g$ deviating from the true gradient can be used in the downstream standard optimization error bound for DRO solution. + +\vspace{-0.3cm} +\paragraph*{Contributions.} +Importantly, we distinguish between two different notions: +\begin{tightenum} +\item The DRO problem formulation with various ambiguity sets, e.g., Wasserstein DRO~\citep{zhaoDatadrivenRiskaverseStochastic2018,mohajerin2018data,gaoDistributionallyRobustStochastic2016}, KL-DRO~\citep{hu2013kullback,ben-talRobustSolutionsOptimization2013}, Sinkhorn DRO~\citep{wang2021sinkhorn}, Kernel DRO~\citep{zhu2021kernel}, etc. +\item The optimization algorithm and analysis for solving the DRO problem, e.g., WRM~\citep{sinha2020certifyingdistributionalrobustnessprincipled}, reformulation techniques~\citep{mohajerin2018data}, SGD~\citep{levyLargeScaleMethodsDistributionally2020}, etc. +\end{tightenum} +In this paper, we do not invent new DRO problem formulations or ambiguity sets (task 1) . Instead, we propose a principled mathematical framework---GF-DRO---for the analysis and design of novel DRO-solving algorithms (task 2) based on the theory of gradient flows and PDE. This framework bridges gradient-flow sampling and DRO, a connection previously missing in the literature. Unlike classical DRO approaches \citep{zhaoDatadrivenRiskaverseStochastic2018,mohajerin2018data,gaoDistributionallyRobustStochastic2016} that usually focus on specific loss functions to derive ad-hoc dual reformulations, GF-DRO provides a general framework to directly solve the variational problem \eqref{eq:proximal-EOT}. This allows the treatment of general, potentially non-convex losses, such as those defined by deep neural networks, for which many classical DRO methods are inapplicable. Our work can be viewed as a general-purpose \emph{sampler-based bi-level optimization framework} \citep{nemirovski2009robust}, where we invent novel DRO solvers by exploiting recently proposed gradient flow samplers, such as Wasserstein-Fisher-Rao (WFR) and Stein variational gradient (SVG) flows (i.e. we do not invent new PDE or gradient flow theory), to the energy functionals informed by DRO. +While previous methods like WRM ~\citep{sinha2020certifyingdistributionalrobustnessprincipled} are fundamentally discretized ODEs, our use of S/PDEs and interacting particle systems advances the theoretical depth of the DRO subject. For instance, Wasserstein flows relies on the log-Sobolev inequality (LSI) constant which is problematic in high dimensions, while the WFR gradient flow we introduce provides a new lane of research that may go beyond the limitations of LSI constant. Among recent sampling-based DRO efforts, FlowDRO \citep{xu2024flow} learns a deterministic transport map via Neural ODEs, and \citet{zhu2024distributionally} analyze a JKO-like iterative scheme; in contrast, GF-DRO leverages the equivalence between the inner DRO problem and a sampling task driven by the \emph{entropy-regularized JKO operator} (Proposition~\ref{lem:sb-klform}), letting us plug in any gradient flow sampler (WGF, WFR, SVG) and naturally handle entropy-regularized Sinkhorn DRO. Ultimately, we demonstrate that DRO problems can be solved and analyzed in a unified, practical algorithmic framework without inventing ad-hoc reformulations. + + +\section{Preliminaries} +\subsection{Gradient Systems and Their Gradient Flow Equations} +The Wasserstein gradient flow (WGF) framework \citep{otto1996double} was introduced into the sampling literature to provide a theoretical foundation; see +\citet{chewi2024statistical,garcia2018continuum} +for recent surveys. +In that framework, one can write a flow equation formally as +\begin{align} + \dot \rho = + - \mathbb G_W(\rho)^{-1}(\rho) \frac{\delta F}{\delta \rho}[ \rho] + = \nabla \cdot\left(\rho\nabla \frac{\delta F}{\delta \rho}[ \rho]\right) + \label{eq:wasserstein-gfe} +\end{align} +using +the inverse of the Wasserstein Riemannian metric tensor: +$\mathbb G_W^{-1}(\rho): T^*_\rho \calM \to T_\rho \calM, \xi \mapsto -\nabla \cdot(\rho\nabla \xi),$ +where $\calM$ is a space or a manifold, $T_\rho \calM$ is the tangent space of $\calM$ at $\rho$ and +$T^*_\rho \calM$ is the cotangent space. +With those ingredients, we can formally define the gradient systems that generate gradient flow equations such as the WGF equation~\eqref{eq:wasserstein-gfe}. +We refer to \citet{mielke2023introduction} for more details. +\begin{definition} + [Gradient system] + We refer to a tuple $\left( \calM, F, \bbG \right)$ + as a gradient system. + It has the gradient structure + identified by: +\begin{tightenum} + \item a space or a manifold $\calM$, + \item an energy functional $F$, + \item a dissipation geometry given by either: + a distance metric defined on $\calM$ or + a Riemannian metric tensor $\mathbb G$. +\end{tightenum} +\label{def:gradient-system} +\end{definition} + +\subsection{Gradient Flow Sampler} +For sampling and inference, +a common choice for the energy functional is the KL divergence, +i.e., +$F(\rho) = \KL(\rho | \pi)$. Under the Wasserstein metric, +through elementary calculation, we obtain from \eqref{eq:wasserstein-gfe} the Fokker-Planck equation (FPE) +\begin{align} + \partial_t \rho = + \nabla \cdot \left( \rho \nabla \log\frac{\rho}{\pi} \right) + = + { \Delta \rho} - \nabla \cdot \left( \rho \nabla \log \pi \right) + . + \label{eq:fokker-planck} + \end{align} +When we express the target as $\pi(x) = \frac1Z \exp(-V(x))$ +where $Z$ is a normalization constant (partition function), \eqref{eq:fokker-planck} is then +$\partial_t \rho = { \Delta \rho} + \nabla \cdot \left( \rho \nabla V \right)$. +Viewed as a dynamical system, the KL divergence energy functional dissipates +along \eqref{eq:fokker-planck} in the steepest descent manner. +Based on Definition~\ref{def:gradient-system}, we say that PDE~\eqref{eq:fokker-planck} has the \emph{gradient structure} that entails the following key ingredients: +\begin{align*} + \begin{cases} + \textrm{{Space} :}& + \text{prob. space } + \mathcal P , + \\ + \textrm{Energy functional} :& {F(\cdot):= \KL(\cdot | \pi)}, + \\ + \textrm{Dissipation Geometry} :& { \text{Wasserstein metric}}. + \end{cases} +\end{align*} + + + + +\subsection{Entropy-regularized Wasserstein DRO} +Works such as \citet{sinha2020certifyingdistributionalrobustnessprincipled,wang2021sinkhorn} considered DRO problems with rather general loss functions as they are based on general-purpose continuous optimization rather than DRO reformulation techniques for special losses. +\citet{wang2021sinkhorn} proposed a specialized algorithm solving the dual formulation of the DRO problem~\eqref{eq:main-ent-dro}. +Different from their dual approach, this paper develops a unified gradient flow sampler framework that directly samples from the primal worst-case distribution that solves the inner problem. + + +\section{A Gradient Flow Framework for Sampling from Worst-case Distributions}\label{sec:gf-dro-method} + +\subsection{Schr\"odinger Problem Formulation of DRO} +Our starting point is the following entropy-regularized JKO (Jordan-Kinderlehrer-Otto) operator from PDE\citep{jordan1998variational, peyre2015entropic} : +\begin{align} + \epsjko_{\tau V}(\rho_0) := + \argmin_{\rho \in \calP} + \left\{\int V \, \dd \rho + \tfrac{1}{2\tau} W^2_\epsilon(\rho, {\rho_0}) \right\} + \label{eq:proximal-EOT} +\end{align} +This operation, +hence the inner maximization problem of DRO, +is a special case of the static Schr\"odinger problem with a free marginal, i.e., half bridge or one-sided bridge. +We now provide a variational characterization enabling us to perform the sampling task in \eqref{eq:ent-jko-reformulation}. +\begin{proposition}\label{lem:sb-klform} + Solving the entropy-regularized JKO operator \eqref{eq:proximal-EOT} is equivalent to solving the Schr\"odinger half bridge problem +\begin{equation} +\label{eq:sb-klform-half-bridge} +\min_{\mathclap{\substack{\Pi\in \calM^2, \\\int \Pi \dd y = \rho_0}}} +\biggl\{ \int V \dd \Pi + \frac{1}{2\tau} \int c(x,y) \dd\Pi + \frac\epsilon{2\tau}\int \log \Pi \dd\Pi \biggr\} +\end{equation} +The optimal marginal distribution of $Y$ in \eqref{eq:sb-klform-half-bridge} is given by a mixture distribution, for some normalization constants $Z_x$: + \begin{align}\label{eq:worst-dist} + \pi_Y = \E_{x\sim \rho_0} \left[ + \dfrac{1}{Z_x}\exp + \left({-\frac{\widetilde V_{x,\tau}(y) }{\epsilon}} \right) + \right], + \end{align} + where $\widetilde V_{x,\tau}(y) := V(y) + \frac{c(y,x)}{2\tau}.$ + Consequently, \eqref{eq:sb-klform-half-bridge} is equivalent to the minimization of the expected KL divergence with respect to the conditional distribution + \begin{align}\label{eq:sb-klform} + \min_{\rho_{Y|X}} + \mathbb{E}_{x\sim\rho_0} + \KL + \left( + \rho_{Y|X=x}(y) + \big| + \tfrac{1}{Z_x} + \exp \left( + - \tfrac{\widetilde V_{x,\tau}(y)}{\epsilon} + \right) + \right) + . + \end{align} +\end{proposition} +The optimal +conditional distribution of \eqref{eq:sb-klform}, denoted by $\pi_{Y|X}$, provides the +$$\text{stochastic entropic transport map}: +\quad +\, x\mapsto \pi_{Y|X=x}(y).$$ +This statement gives the overall variational structure of the DRO problem~\eqref{eq:main-ent-dro}. +We are now ready to introduce our proposed method GF-DRO in the next section. +\subsection{Gradient Flow Sampler-based DRO} + Using the variational problem~\eqref{eq:sb-klform}, we define the energy functional as +the KL divergence energy functional (without expectation): +\begin{equation} +\label{eq:conditional-sampling-energy} + \begin{split} + F(\rho) :&= + \tfrac{\epsilon}{2\tau} + \KL + \left( + \rho\ + \bigg| + \tfrac{1}{Z_x} + \exp \left( + -\tfrac{\widetilde V_{x,\tau}(y)}{\epsilon} + \right) + \right) \\ + &= + \int V\, \dd \rho + + \frac{1}{2\tau} W_c^2(\rho, \delta_x) + + + \frac{\epsilon}{2\tau} \int \rho \log \rho + + \const + \end{split} +\end{equation} + Note that the formulation on the right-hand side was also observed by \citet{chen2022improved} in studying the proximal sampler. + +With those ingredients, +in this paper, we propose to achieve +sampling from the conditional distribution $\pi_{Y\mid X}$ by simulating the \emph{gradient system +$\displaystyle\left( +\calP, F, \mathbb G +\right)$}. +This results in the formal gradient flow equation: +\begin{align} +\dot\rho = - \mathbb G^{-1}(\rho)\, DF(\rho). +\label{eq:general-gradient-flow} +\end{align} +where we can freely choose the dissipation geometry $\mathbb G$ for the gradient flow. +Then, +our central methodology is the following perspective of sampling from conditional distributions +connected to the KL-minimization problem~\eqref{eq:sb-klform}. +Consider solving the inner maximization problem~\eqref{eq:main-ent-dro} via the following two-step sampling procedure: +\begin{algorithm}[h!] +\caption{Worst-case Distribution Sampler via Gradient Flows} +\label{alg:sampler} +\begin{algorithmic}[1] + \STATE {\bfseries Input:} an initial distribution ${\rho}_0$ to sample from (e.g. empirical distribution $\widehat{\rho}_N$ in data-driven DRO) + \STATE Sample $X \sim {\rho}_0$ + \STATE Sample $Y \sim \pi_{Y\mid X}$ + using a gradient flow + (e.g. with energy functional given by \eqref{eq:conditional-sampling-energy}) + \STATE {\bfseries Output:} sample $Y$ from the worst-case distribution +\end{algorithmic} +\end{algorithm} + + + + +Using the gradient flow sampler, we now propose the following general-purpose gradient flow sampler-based DRO framework. +\begin{algorithm}[h!] +\caption{Gradient Flow Sampler-based DRO} +\label{alg:GF-DRO} +\begin{algorithmic}[1] + \STATE {\bfseries Input:} Initial distribution $\rho_0$, e.g., empirical distribution $\rho_0 = \widehat{\rho_N}$, constraint set $\Theta$, $\tau, \epsilon >0$, stepsize $r_s$. + \FOR{ iteration count $s = 0, \dots$} + \STATE Generate a sample from the worst-case distribution $y^s \sim \pi_Y$ by using the gradient flow sampler in Algorithm~\ref{alg:sampler} + \STATE DRO step: $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-r_s \nabla_\theta \ell(\theta^s, y^s))$ + \ENDFOR +\end{algorithmic} +\end{algorithm} +Other straightforward variants, such as using sample average approximation (SAA) instead of stochastic approximation (SA) above, are possible. + +\subsubsection{Wasserstein Gradient Flow Sampler} +As the first practical outcome of our theoretical insights, we instantiate a Wasserstein gradient flow (WGF) sampler for the entropy-regularized Wasserstein DRO problem. +We consider the Wasserstein gradient system with the driving functional $F$ and the Wasserstein metric as the dissipation geometry: + $\left( \calP, F, W_2 \right).$ + +In sampling algorithms, this gradient flow is typically +implemented by discretizing the Langevin SDE +$$ +dX_t = +- + \tfrac{2\tau}{\epsilon}\nabla\widetilde V_{x, \tau}(X_t) dt + dW_t, +$$ +which results in the following forward Euler discretization known as the unadjusted Langevin algorithm (ULA). +Note that we use a scaled stepsize. +\begin{lemma} + The forward Euler discretization of the Wasserstein gradient flow equation of the energy functional $F$ in \eqref{eq:conditional-sampling-energy} is given by the difference equation at step $t$: + \begin{align} + X_{t+1} = X_t + - + \eta_t \nabla \widetilde V_{x, \tau}(X_t) + \sqrt{\eta_t\frac\epsilon\tau} \xi_t + \label{eq:ula-proximal-general-D-W2} + \end{align} + where $\xi_t$ is a standard normal random variable and + $\eta_t$ is the stepsize. +\end{lemma} +We note the stepsize scaling in front of the stochastic variable $\xi_t$ is different from the vanilla ULA update rule. + +Adapting the above WGF dynamics to our GF-DRO framework in Algorithm~\ref{alg:GF-DRO} for generating samples from the worst-case distribution , we obtain the following discrete-time DRO algorithm summarized in Algorithm~\ref{alg:SDRO-NGD}. + +\begin{algorithm}[h!] +\caption{Entropy-regularized Wasserstein DRO via WGF} +\label{alg:SDRO-NGD} +\begin{algorithmic}[1] + \STATE {\bfseries Input:} Empirical distribution $\widehat{\rho_N}$, constraint set $\Theta$, $\tau, \epsilon >0$, stepsize sequence $\{r_s > 0\}_{s=0}^{S-1}$, inner stepsize $\eta$, inner iterations $T$, number of samples $m$. + + \FOR{$s = 0, \dots, S-1$} + \STATE Sample $x^s \sim \widehat{\rho_N}$ + \STATE Initialize $y_{0}^{i,s} \leftarrow x^s, i=1,\dots,m$ + \FOR{$t = 0, \dots, T-1$} + \STATE Sample $\xi^{i,s}_t \sim\mathcal{N}(0,I)$ + \STATE Update sample using \eqref{eq:ula-proximal-general-D-W2}: \\ $y_{t+1}^{i,s} \leftarrow y_{t}^{i,s} - \eta\nabla\widetilde V_{x^s, \tau}(y_{t}^{i,s}) + \sqrt{\eta\epsilon/\tau} \xi^{i,s}_t$ + \ENDFOR + \STATE $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-r_s \sum_{i=1}^m \frac{1}{m}\nabla_\theta \ell(\theta^{s},y_{T}^{i,s}))$ + \ENDFOR + \STATE {\bfseries return} $\theta^S$ +\end{algorithmic} +\end{algorithm} + +\begin{remark}\label{rm:WRM} + [\citet{sinha2020certifyingdistributionalrobustnessprincipled}'s WRM] + For the penalized Wasserstein DRO problem, + i.e. + $\epsilon=0$ in the entropy-regularized Wasserstein DRO problem \eqref{eq:main-ent-dro} , + the step in \eqref{eq:ula-proximal-general-D-W2} specializes to the update rule: + \begin{align} + X_{t+1} = X_t + - \eta_t \nabla \widetilde V_{x, \tau}(X_t) + \label{eq:ula-proximal-general-D-W2-epsilon-0} + \end{align} + which coincides with the inner SGD step used in the WRM algorithm by \citet{sinha2020certifyingdistributionalrobustnessprincipled}. +Hence, their WRM algorithm is a special case (with only ODE) of our GF-DRO framework in Algorithm~\ref{alg:GF-DRO}. +\end{remark} +Through the example above, we see the value of this paper's gradient flow perspective: it can easily generalize the WRM algorithm~\citep{sinha2020certifyingdistributionalrobustnessprincipled} from ODE to a novel SDE-based or PDE-based algorithm for the Sinkhorn DRO problem using \eqref{eq:ula-proximal-general-D-W2}. +Therefore, the gradient flow perspective is not simply a theoretical formulation -- it lets us effortlessly design new algorithms to solve DRO without resorting to ad-hoc modifications of other DRO methods. +Moreover, we will later go beyond the standard Wasserstein gradient flow and introduce more advanced gradient flows such as the Wasserstein Fisher-Rao (WFR) and Stein variational gradient (SVG) flows. + +\subsubsection{Wasserstein Fisher-Rao Flow Sampler} +Consider the WFR gradient system of the energy functional $F$, i.e., the triple $\left( \calP, F, \WFR \right)$, where $\WFR$ is the Wasserstein-Fisher-Rao metric, a.k.a. the \emph{Hellinger-Kantorovich} metric restricted to the probability space\footnote{Note that there are many cases of misnomer in the machine learning literature: WFR should technically be defined over the space of positive measures, not the space of probability measures; see \citet{mielkeNotesHellingerDistance2025} for a historical account. The latter corresponds to the spherical Hellinger-Kantorovich metric. Although their gradient flow solutions can be easily related to each other via the mass scaling. See \citet{mielke2025hellinger} for technical details.}. +Specifically, we consider the HK/WFR gradient system associated with the reaction-diffusion PDE: +\begin{align} + \partial_t \rho + &= \alpha\, \mathrm{div} \left( \rho \nabla \frac{\delta F}{\delta \rho} \right) - \beta\, \rho + \left(\frac{\delta F}{\delta \rho} - \int \frac{\delta F}{\delta \rho}\dd \rho \right) + \label{eq:wfr-gradient-flow} +\end{align} + where $\alpha,\beta>0$ are the coefficients of the Wasserstein (transport) and Fisher-Rao (reaction) components of the HK/WFR metric, respectively. +By simulating the interacting particle system associated with \eqref{eq:wfr-gradient-flow}, +we propose a WFR-based worst-case distribution sampler for SDRO as detailed in Algorithm \ref{alg:SDRO-WFR}. +The primary distinction of this sampler, compared to the WGF version, is the addition of a birth-death mechanism. +Crucially, this mass reallocation mechanism enables the system to concentrate its search within low-energy regions and effectively escape from local optima. See details in Appendix~\ref{sec:wfr-alg}. + + +\subsubsection{Stein Variational Gradient Flow Sampler} +In an attempt to simulate \eqref{eq:fokker-planck} using deterministic particle-based methods instead of SDEs, +\citep{liu2016stein} +proposed the Stein variational gradient descent (SVGD) algorithm, which is an +implementable +deterministic algorithmic version of \eqref{eq:fokker-planck}. +For a target $\pi$, at time step $t$, +it updates the particle locations via the following gradient descent scheme. +\begin{align*} + X^i_{t+1} = X^i_t + \eta\cdot \Big( \frac{1}{m}\sum_{j=1}^m \nabla \log\pi(X^j_t)k(X^j_t,X^i_t ) + + \frac{1}{m}\sum_{j=1}^m \nabla_2 k(X^j_t,X^i_t ) \Big). +\end{align*} +Here, $X^i_t$ represents the position of the $i$-th particle at time step $t$, $\eta$ is the stepsize, $m$ is the total number of particles. +$k(\cdot,\cdot)$ is a positive definite kernel function, and $\nabla_2$ denotes the gradient with respect to the second argument of the kernel. +Applying SVGD to the inner problem of DRO, we propose Algorithm~\ref{alg:SDRO-SVG}. See details in Appendix~\ref{sec:svg}. + + +\subsubsection{Rejection Sampler} +We also propose Algorithm~\ref{alg:SDRO_rgo}, which is a DRO algorithm based on rejection sampler (RGO). This approach is based on the backward step of the proximal sampler \citep{lee2021structured,chen2022improved,wibisono2025mixing}, as detailed in Appendix\ref{sec:rgo}. However, this method requires the loss function to be $L$-smooth and cannot be applied when $\tau$ is relatively large, which we will demonstrate in later experiments. + +\begin{remark}[\textbf{Dynamic interpolation: merits of a dynamic model}] + Our gradient flow framework produces a principled family of distributions $\{\rho_t\}_{t\geq 0}$, where each $\rho_t$ solves a well-defined variational problem and corresponds to a specific perturbation intensity controlled by $t$. This dynamic structure has practical value: when the terminal distribution $\rho_{t_T}$ produces unrealistic samples under a ``bad'' hyperparameter (Figure~\ref{fig:evolution-image}), one can directly select an earlier $\rho_{t_i}$ for sample-based SGD without re-running the sampler with a different parameter (e.g.\ a smaller $\tau$). Unlike post-hoc interpolation between independent runs, every $\rho_t$ along the flow inherits structural guarantees from gradient flow theory, in particular monotone energy dissipation along $F$. +\begin{figure}[h!] + \centering + \includegraphics[width=0.8\linewidth]{1_exp_convergence.pdf} + \caption{Evolution along the gradient flow under a ``bad'' hyperparameter. The first column displays the original images. The subsequent columns show the evolving states of the particles at intervals of 1000 steps, from Step 1000 to Step 6000. } + \label{fig:evolution-image} + \vspace{-0.3cm} +\end{figure} +\end{remark} + +\section{Analysis of Gradient Flows} +For algorithmic design, one paradigm is to first obtain intuition and insights from principled mathematical analysis before constructing practical numerical algorithms. +While the development in machine learning research does not always follow this pattern, we argue in this paper that, by first understanding the theoretical limits of the gradient flow, we can design novel DRO algorithms that performs as expected theoretically. This is done without inventing new theoretical framework, but by leveraging the existing gradient flow and PDE analysis \citep{otto2000generalization, jordan1998variational} specialized to DRO. +The discrete-time algorithmic analysis will follow in a later section. + + + +In DRO works such as \citep{sinha2020certifyingdistributionalrobustnessprincipled} +and subsequent variants, +complexity analysis typically involves controlling the gradient estimation error. +That is, to control +the deviation +from the true gradient used for DRO. +For illustration, let us consider the +DRO problem \eqref{eq:main-ent-dro}. +Note that +setting $\epsilon = 0$ recovers the +problem of \citep{sinha2020certifyingdistributionalrobustnessprincipled}. +Our goal is to analyze the estimation of DRO stochastic gradient $\hat g$ +using PDE tools. +With our gradient flow sampler-based DRO algorithm, +we aim to generate samples from the worst-case distribution $\pi_Y$, which is the entropic JKO solution + +\begin{align} +\label{eq:entropic-jko} +\pi_Y = \epsjko_{\tau V}(\widehat{\rho_N}) +\end{align} + +Following the framework of Algorithm~\ref{alg:sampler}, + for $x\sim \rho_0$, +we generate samples from the worst-case distribution +by sampling from the conditional distribution, $y\sim \rho^*_{Y|X=x}$. +Then, for the outer DRO problem, we can use the sample-based gradient estimate $\widehat g := \nabla_\theta \ell(\theta, y)$ to update the parameter $\theta$. +The following result uses gradient flow analysis to bound the gradient estimate error. +We note that the results are stated in terms of the ideal continuous-time gradient flow, which is not yet the mixing time of the discrete-time sampler; we will detail the discrete-time algorithmic analysis in a later section. +The gradient flow analysis provides a key insight and guideline for the design of the gradient flow sampler-based DRO algorithm. + + + +For notational simplicity, we abbreviate $\widetilde V_{x,\tau}$ as $\widetilde V$ in this section and, specifically, for the case of quadratic transport cost $c(y,x) = \|x-y\|^2$, we define the following. +Recall the functional $F(\rho) = +\frac{\epsilon}{2\tau} +\KL + \left( + \rho\ + \bigg| + \tfrac{1}{Z_x} + \exp \left( + -\tfrac{\widetilde V_{x,\tau}(y)}{\epsilon} + \right) + \right)$ as in \eqref{eq:conditional-sampling-energy}. +\begin{definition} +\label{as:gf-properties} +\begin{enumerate} +\item \textbf{$L$-smoothness:} A differentiable function $f$ is $L$-smooth if there exists a constant $L > 0$ such that + \begin{align} + \|\nabla f(x) - \nabla f(x')\| \leq L \|x - x'\|, \quad \forall x, x' \in \mathcal{X}. + \label{eq:L-smoothness} + \end{align} + \item \textbf{Semi-convexity of the regularized potential $\widetilde V$ :} There exists a constant $\lambda > 0$ such that + \begin{align} + \nabla ^2 \widetilde V \geq \lambda I + \iff + \nabla ^2 V + \frac1{2\tau }I \geq \lambda I + \label{eq:semi-convexity} + \end{align} + \item \textbf{Gradient dominance/Polyak-\L ojaciewicz (PL) +inequality of $\widetilde V$ :} + There exists a constant $\lambda > 0$ such that + \begin{align} + \big|\nabla \widetilde V \big|^2 \geq \lambda \widetilde V, + \quad \forall y \in \mathcal X + \label{eq:gradient-dominance-PL} + \end{align} + \item \textbf{Functional PL inequality over measures along GF}: There exists a constant $\lambda > 0$ such that + \begin{align} + \left\|\frac{\dd}{\dd t} F(\rho_t)\right\|^2 \geq \lambda F(\rho_t), + \label{eq:generalized-PL} + \end{align} + which is equivalent to the $\lambda$-\textbf{logarithmic Sobolev inequality} (LSI) for $\pi = \tfrac{1}{Z_x} + \exp \left( + -\tfrac{\widetilde V_{x,\tau}(y)}{\epsilon} + \right)$, + \begin{align} + \int \Bigg\| + \nabla \log + \dfrac{\rho}{\pi} \Bigg\| ^2\dd \rho + \geq + \lambda + \KL(\rho | \pi) + \label{eq:LSI-along-GF} + \end{align} + along the solution $\rho_t$. +\end{enumerate} +\end{definition} + +It is immediate that +$1.\implies 2.$ +and +$1.\implies 3$. +We note that +the second condition in Definition~\ref{as:gf-properties} +does not require the function $V$ itself to be convex. Hence, the DRO loss $\ell(\theta, x)$ does not necessarily need to be concave in variable $x$. +In such cases, we can already obtain the geodesic convexity of $F$ in the Wasserstein space, termed displacement convexity. + + Letting the DRO objective $\Phi(\theta): = \max_{\rho\in\calP}\left\{ + \int \ell(\theta, z)\dd\rho{(z)} - \tfrac1{2\tau} W^2_{\epsilon}(\rho,\widehat{\rho_N})\right\}$, using standard analysis of gradient flows, we obtain the following ideal gradient estimate. +\begin{proposition}\label{prop:gradient_oracle_error_control} + Denote the initial sample $x^i\sim \widehat{\rho_N}$ after running the Wasserstein gradient flow sampler for time $t$ as $y^i_t\sim \rho^t_{Y|X=x^i}$. + For a fixed $\theta$, + suppose that $\nabla_\theta\ell(\theta, y)$ is $L_f$-Lipschitz continuous in $y$ and + $\widetilde V_{x, \tau}(y) : = -\ell(\theta, y)+\tfrac1{2\tau}c(y, x)$ is $L$-smooth and either +$\lambda$-convex + with $\lambda > 0$ + or + satisfies the + $\lambda$-LSI + as in Definition~\ref{as:gf-properties}. + Then, for sufficiently large $N$, in order to generate an $\epsilon_\text{grad}$-gradient estimate in expectation , i.e., + \begin{align*} + \mathbb{E}\!\left[\, \bigg|\frac1N \sum_{i=1}^N \nabla_\theta \ell(\theta, y^i_t) + - + \nabla_\theta + \Phi(\theta) + \bigg| \,\right] + {\leq} + \epsilon_\text{grad}, + \end{align*} + the Wasserstein gradient flow sampler needs to run for time at least\; + $\displaystyle t \gtrsim \calO \left(\frac{1}{\lambda}\log{\frac{L_f}{\sqrt{\lambda}\epsilon_\text{grad}}}\right)$. +\end{proposition} + +\begin{remark} + The Lipschitz condition on $y \mapsto \nabla_\theta \ell(\theta, y)$ above is mild and standard, satisfied for example by losses with bounded mixed Hessian $\nabla_y \nabla_\theta \ell$. The same condition will be used in our discrete-time complexity analysis (Section~\ref{sec:complexity}). +\end{remark} + + + +Results such as Proposition~\ref{prop:gradient_oracle_error_control} are based on the displacement convexity or PL/LSI in the Wasserstein space. +The value of our general gradient flow perspective is to let us freely choose the gradient flow geometry, not confined to Wasserstein. +This is not just for theoretical considerations --- the estimate such as +\eqref{eq:gf_time_to_epsilon} +depends crucially on the (PL/convexity) constant $\lambda$, which has been a major limitation of the Langevin type samplers in the literature. + The potential speed-up of WFR over pure Wasserstein gradient flow comes from the Hellinger/Fisher-Rao reaction component when a suitable warm-start initialization is available; see \citet{luBirthdeathDynamicsSampling2023} and Appendix~\ref{sec:dual-review} for the precise warm-start condition. +It provides a simple insight for algorithmic design: the unbalanced WFR gradient flow can be used to speed up the sampling process for DRO. +This insight is later validated in the numerical studies. + + +As noted earlier, Proposition~\ref{prop:gradient_oracle_error_control} +is aimed at providing the intuition for the behavior of the gradient flow sampler-based DRO algorithm; it is not the practical complexity estimate based on sampler's mixing time. +It serves as a guideline for the design of the gradient flow sampler-based DRO algorithm using existing tools from PDE/SDE. +Next, we provide optimization complexity estimate that characterizes the practical sampler-based DRO algorithm. + + + + + +\section{Optimization Complexity Analysis}\label{sec:complexity} +The DRO problem \eqref{eq:main-ent-dro} can be written as +$\min_{\theta\in\Theta} \Phi(\theta)$. +We analyze the computational complexity of our proposed discrete-time algorithms, aiming to find an $\epsilon_{\text{opt}}$-stationary point $\theta^{S}$ at the last iteration $S$, + i.e., $\mathbb{E}[\|\nabla\Phi(\theta^{S})\|^{2}]\le\epsilon_{\text{opt}}^{2}$. +Our analysis uses a standard framework for non-convex stochastic optimization \citep{ghadimi2013stochastic}. The outer loop performs SGD on $\theta$, while the inner loop generates samples to approximate the conditional worst-case distribution. The key challenge is controlling the bias in the stochastic gradient. We make the following assumptions regarding the objective function and the sampling process. + +\begin{assumption}\label{as:global_assumptions} + \begin{enumerate} + \item \label{as:totalsmooth} \textbf{Smoothness of the DRO objective in $\theta$ :} There exists a constant $L_{\Phi} > 0$ such that + \begin{equation*} + \|\nabla\Phi(\theta_1) - \nabla\Phi(\theta_2)\| \le L_{\Phi}\|\theta_1-\theta_2\|, \forall \theta_1,\theta_2\in\Theta + \end{equation*} + \item \label{as:fsmooth}\textbf{Lipschitz continuity of the gradient oracle in $z$ :} There exists a constant $L_{f} > 0$ such that, for every $\theta \in \Theta$ , + \begin{equation*} + \|\nabla_{\theta}\ell(\theta, z_1 ) - \nabla_{\theta}\ell(\theta, z_2 )\| \le L_{f}\| z_1-z_2 \|, \forall z_1,z_2\in\mathcal{Z} + \end{equation*} + \item \label{as:gradest}\textbf{Sampler error and bounded variance:} The inner-loop sampler (Algorithm~\ref{alg:sampler}) generates a distribution $\widehat\rho_{Y|X=x}$, and $\mathbb{E}_{x \sim \widehat{\rho_N}}[W_2(\widehat\rho_{Y|X=x}, \pi_{Y|X=x})] \le \delta_{\text{sample}}$. The stochastic gradient estimator $\widehat g$ has bounded variance $\sigma^2$, i.e., $\mathbb{E}[\|\widehat g-\mathbb{E}[\widehat g ] \|^{2}]\le \sigma^2$ . + \end{enumerate} +\end{assumption} +Under these standard assumptions, we can bound the gradient bias and establish a general convergence result for the outer loop. + +\begin{theorem}[Outer Loop Convergence] +\label{thm:outer_loop} +Let Assumptions \ref{as:global_assumptions} hold. With a stepsize $r = \sqrt \frac{1}{SL_\Phi\sigma^2}$, the outer loop requires $S = O(\frac1{\epsilon_{\text{opt}}^4})$ iterations to find an $\epsilon_{\text{opt}}$-stationary point (i.e. $\mathbb{E}[\|\nabla\Phi(\theta^{S})\|^{2}]\le\epsilon_{\text{opt}}^{2}$) , provided the error $\delta_{\text{sample}}$ in Assumption~\ref{as:global_assumptions}.\ref{as:gradest} is controlled such that $\delta_{\text{sample}} = O(\frac {\epsilon_{\text{opt}}} {L_f})$. +\end{theorem} + +This complexity aligns with standard non-convex stochastic algorithms. Next, we derive the complexity of Algorithm~\ref{alg:SDRO-NGD} as an example. For the analysis of the ULA-based sampler (Algorithm \ref{alg:SDRO-NGD}), we introduce the following assumption on the inner target distribution. + +\begin{assumption}\label{as:LSI} +For any fixed $\theta$ and $x$, the conditional distribution $\pi_{Y|X=x}$ is $L_{U}$-smooth and satisfies the $\lambda_U$-log-Sobolev inequality (LSI); see Definition~\ref{as:gf-properties} for the definitions . +\end{assumption} + + + + + + +Assumption \ref{as:LSI} provides the necessary framework to determine the number of inner ULA iterations \citep{vempala2019rapid} required to achieve the sampling accuracy $\delta_{\text{sample}}$ (as specified in Assumption~\ref{as:global_assumptions}.\ref{as:gradest}). Crucially, Assumption \ref{as:LSI} relaxes the strict log-convexity assumption commonly adopted in previous works \citep{sinha2020certifyingdistributionalrobustnessprincipled, wang2021sinkhorn}. By combining the derived inner loop complexity analysis with the outer loop convergence rate from Theorem \ref{thm:outer_loop}, we can establish the total computational complexity. + + +\begin{remark}[Beyond smoothness] +Recent work shows that ULA converges under dissipativity alone \citep{johnston2025performance}, without requiring global smoothness or LSI. Since Theorem~\ref{thm:outer_loop} (outer loop) is sampler-agnostic, any improved inner-loop bound directly translates into improved total complexity. In particular, plugging in such relaxed convergence results would extend our framework to non-smooth losses (e.g., ReLU networks) more rigorously, replacing Assumption~\ref{as:LSI}. +\end{remark} + + +\begin{theorem}[Complexity of GF-DRO (Algorithm \ref{alg:SDRO-NGD}) ]\label{thm:ula} +Under Assumptions \ref{as:global_assumptions}, and \ref{as:LSI}, the total complexity for Algorithm \ref{alg:SDRO-NGD} to find an $\epsilon_{\text{opt}}$-stationary point is $\tilde{O}\left(\frac d {\epsilon_{\text{opt}}^6}\right)=O\left(\frac d {\epsilon_{\text{opt}}^6} \cdot\log \frac 1 {\epsilon_{\text{opt}}} \right)$. +\end{theorem} + +The detailed derivations for the gradient bias, and the proofs of Theorem \ref{thm:outer_loop} and Theorem \ref{thm:ula} are provided in Appendix~\ref{ap:complexity_proofs}. + + + + + + + + + + + + + + + + + + + +\section{Experiments}\label{sec:experiments} + +We conduct numerical experiments on different tasks to validate our theoretical insights. Our goal is to compare the performance of four different DRO methods: Algorithm~\ref{alg:SDRO-WFR} (WFR-DRO), Algorithm~\ref{alg:SDRO-NGD} (WGF-DRO), the dual method for SDRO (Dual) \citep{wang2021sinkhorn}, and WRM \citep{sinha2020certifyingdistributionalrobustnessprincipled}. We also compare algorithms based on Stein Variational Gradient (SVG-DRO) (Algorithm~\ref{alg:SDRO-SVG}) method and Restricted Gaussian Oracle \citep{lee2021structured} (RGO-DRO) (Algorithm~\ref{alg:SDRO_rgo}) method with those methods in Appendices~\ref{sec:appx_features} and~\ref{sec:experiment3} . For methodological consistency across all experiments, the Dual method uses Randomized Truncation MLMC \citep{blanchet2015unbiased} as suggested in \citep{wang2021sinkhorn}, and the WRM solves its inner problem using gradient descent. Sections~\ref{sec:lenet_mnist} and~\ref{sec:cifar_resnet} evaluate adversarial robustness on increasingly deep convolutional architectures, while Section~\ref{sec:exp_latent_wfr} demonstrates the qualitative behaviour of the WFR sampler on a high-dimensional generative latent space. +All experiments were conducted on a laptop with an NVIDIA RTX A3000 GPU using Python. The code is available at \url{https://github.com/ZusenXu/GFS-DRO} + + + + + + + + + + + + + + + + + + + + + + + + + + + + +\subsection{Adversarial Robustness on MNIST with LeNet-5} +\label{sec:lenet_mnist} + +We evaluate our methods on MNIST using the LeNet-5 architecture in a high-dimensional, end-to-end training setting where the entire network is trained with DRO algorithms. We assess robustness using PGD attacks under both $L_2$ and $L_\infty$ norm constraints, and compare our proposed WFR-DRO and WGF-DRO ($\tau=1.0, \epsilon=0.05, m=8$) against WRM and the Dual Sinkhorn DRO approach. + +\begin{table*}[htbp] +\centering +\begin{minipage}[t]{0.48\textwidth} +\centering +\caption{PGD-$L_2$ Robustness on MNIST LeNet-5 (Test Error \%, mean $\pm$ std)} +\label{tab:lenet_l2} +\resizebox{\linewidth}{!}{% +\begin{tabular}{lcccc} +\toprule +Method & $\Delta=0.00$ & $\Delta=0.025$ & $\Delta=0.05$ & $\Delta=0.075$ \\ +\midrule +SAA & $0.92{\scriptstyle\pm0.09}$ & $3.05{\scriptstyle\pm0.40}$ & $10.80{\scriptstyle\pm1.20}$ & $27.44{\scriptstyle\pm2.86}$ \\ +WRM & $0.98{\scriptstyle\pm0.09}$ & $3.47{\scriptstyle\pm0.39}$ & $11.66{\scriptstyle\pm1.50}$ & $29.22{\scriptstyle\pm3.18}$ \\ +Dual & $1.00{\scriptstyle\pm0.06}$ & $3.21{\scriptstyle\pm0.24}$ & $\phantom{0}9.62{\scriptstyle\pm0.74}$ & $24.20{\scriptstyle\pm1.82}$ \\ +WGF-DRO & $0.92{\scriptstyle\pm0.08}$ & $2.97{\scriptstyle\pm0.36}$ & $\phantom{0}8.56{\scriptstyle\pm0.96}$ & $21.57{\scriptstyle\pm1.72}$ \\ +WFR-DRO & $0.92{\scriptstyle\pm0.05}$ & $\mathbf{2.86}{\scriptstyle\pm0.18}$ & $\mathbf{\phantom{0}8.27}{\scriptstyle\pm0.29}$ & $\mathbf{20.81}{\scriptstyle\pm0.71}$ \\ +\bottomrule +\end{tabular}% +} +\end{minipage}\hfill +\begin{minipage}[t]{0.48\textwidth} +\centering +\caption{PGD-$L_\infty$ Robustness on MNIST LeNet-5 (Test Error \%, mean $\pm$ std)} +\label{tab:lenet_linf} +\resizebox{\linewidth}{!}{% +\begin{tabular}{lcccc} +\toprule +Method & $\Delta=0.00$ & $\Delta=0.05$ & $\Delta=0.10$ & $\Delta=0.15$ \\ +\midrule +SAA & $0.92{\scriptstyle\pm0.09}$ & $3.48{\scriptstyle\pm0.56}$ & $11.05{\scriptstyle\pm1.98}$ & $27.70{\scriptstyle\pm4.52}$ \\ +WRM & $0.98{\scriptstyle\pm0.09}$ & $3.58{\scriptstyle\pm0.54}$ & $11.54{\scriptstyle\pm2.25}$ & $29.18{\scriptstyle\pm5.13}$ \\ +Dual & $1.00{\scriptstyle\pm0.06}$ & $3.13{\scriptstyle\pm0.30}$ & $\phantom{0}8.86{\scriptstyle\pm1.07}$ & $21.29{\scriptstyle\pm2.88}$ \\ +WGF-DRO & $0.92{\scriptstyle\pm0.08}$ & $2.81{\scriptstyle\pm0.43}$ & $\phantom{0}7.57{\scriptstyle\pm1.27}$ & $17.79{\scriptstyle\pm2.72}$ \\ +WFR-DRO & $0.92{\scriptstyle\pm0.05}$ & $\mathbf{2.68}{\scriptstyle\pm0.23}$ & $\mathbf{\phantom{0}7.41}{\scriptstyle\pm0.56}$ & $\mathbf{17.30}{\scriptstyle\pm1.57}$ \\ +\bottomrule +\end{tabular}% +} +\vspace{-0.3cm} +\end{minipage} +\end{table*} + +As shown in Tables~\ref{tab:lenet_l2} and~\ref{tab:lenet_linf}, WFR-DRO consistently yields the lowest test error across all non-zero attack intensities $\Delta$, with WGF-DRO and WFR-DRO essentially tied on clean accuracy. WGF-DRO outperforms WRM under non-trivial perturbations, suggesting that entropy regularization help in non-convex landscapes; the birth--death mechanism of WFR provides further improvement over WGF-DRO and outperforms the Dual baseline as well. WRM performs on par with SAA (within one standard deviation), which +is expected in the non-convex setting\citep{sinha2020certifyingdistributionalrobustnessprincipled}. For a complementary comparison on the convex feature-extracted CIFAR-10 setting, including RGO-DRO and SVG-DRO, see Appendix~\ref{sec:appx_features}. + + +\subsection{Adversarial Robustness on CIFAR-10 with ResNet-18}\label{sec:cifar_resnet} +We further validate the scalability of our methods in high-dimensional tasks by fine-tuning a pretrained ResNet-18 end-to-end on CIFAR-10. The DRO hyperparameters are $\tau = 0.1$ and $\epsilon = 0.05$ for Dual method, WGF-DRO and WFR-DRO. To align the comparison between WRM and methods based on SDRO, we set $\tau =0.1$ for WRM. And $m=8$ particles are used in WGF-DRO and WFR-DRO. The inner sampler uses step size $0.01$ for $20$ iterations across all methods. For the Dual baseline, we use the Randomized Truncation MLMC estimator \citep{blanchet2015unbiased} with maximum truncation level $4$. All methods are trained for 20 epochs with batch size 256. + +Tables~\ref{tab:resnet_l2} and~\ref{tab:resnet_linf} report the mean $\pm$ std of PGD-$L_2$ and PGD-$L_\infty$ test error under different attack intensities over 5 seeds. WFR-DRO achieves the lowest error across all non-zero attack intensities under both norms. WGF-DRO comes second, confirming that replacing the deterministic ODE with SDE alone already bring most of the robustness benefit, while WFR-DRO show an additional reduction over WGF-DRO. The Dual baseline performs well compared to WRM, suggesting that entropy regularization helps in this non-convex regime. WRM provides marginal improvement over SAA, consistent with WRM's reliance on convexity \citep{sinha2020certifyingdistributionalrobustnessprincipled} that fails to hold here. Detailed experimental settings, wall-clock timing, outer-loop convergence diagnostics, and a $\tau$-sensitivity analysis can be found in Appendix~\ref{sec:appx_diagnostics}. + +\begin{table*}[h!] +\centering +\begin{minipage}[t]{0.48\textwidth} +\centering +\caption{PGD-$L_2$ Robustness on CIFAR-10 with ResNet-18 (Test Error \%, mean $\pm$ std)} +\label{tab:resnet_l2} +\resizebox{\linewidth}{!}{% +\begin{tabular}{lccccc} +\toprule +Method & $\Delta=0.00$ & $\Delta=0.005$ & $\Delta=0.01$ & $\Delta=0.015$ \\ +\midrule +SAA & $6.35{\scriptstyle\pm0.77}$ & $25.79{\scriptstyle\pm1.06}$ & $55.38{\scriptstyle\pm1.02}$ & $78.32{\scriptstyle\pm0.76}$ \\ +WRM & $6.27{\scriptstyle\pm0.55}$ & $22.27{\scriptstyle\pm0.49}$ & $47.76{\scriptstyle\pm1.80}$ & $71.24{\scriptstyle\pm2.28}$ \\ +Dual & $14.12{\scriptstyle\pm0.99}$ & $19.21{\scriptstyle\pm1.10}$ & $25.33{\scriptstyle\pm1.44}$ & $32.00{\scriptstyle\pm1.67}$ \\ +WGF-DRO & $12.09{\scriptstyle\pm0.75}$ & $16.47{\scriptstyle\pm0.69}$ & $21.81{\scriptstyle\pm0.88}$ & $27.70{\scriptstyle\pm1.06}$ \\ +WFR-DRO & $11.10{\scriptstyle\pm0.60}$ & $\mathbf{15.39}{\scriptstyle\pm0.73}$ & $\mathbf{20.63}{\scriptstyle\pm0.81}$ & $\mathbf{26.73}{\scriptstyle\pm0.72}$ \\ + +\bottomrule +\end{tabular}% +} +\end{minipage}\hfill +\begin{minipage}[t]{0.48\textwidth} +\centering +\caption{PGD-$L_\infty$ Robustness on CIFAR-10 ResNet-18 (Test Error \%, mean $\pm$ std)} +\label{tab:resnet_linf} +\resizebox{\linewidth}{!}{% +\begin{tabular}{lccccc} +\toprule +Method & $\Delta=0.00$ & $\Delta=0.005$ & $\Delta=0.01$ & $\Delta=0.015$ \\ +\midrule +SAA & $6.35{\scriptstyle\pm0.77}$ & $36.34{\scriptstyle\pm1.31}$ & $72.46{\scriptstyle\pm1.12}$ & $90.67{\scriptstyle\pm0.79}$ \\ +WRM & $6.27{\scriptstyle\pm0.55}$ & $31.26{\scriptstyle\pm0.88}$ & $65.07{\scriptstyle\pm2.12}$ & $86.35{\scriptstyle\pm1.57}$ \\ +Dual & $14.12{\scriptstyle\pm0.99}$ & $21.42{\scriptstyle\pm1.20}$ & $30.19{\scriptstyle\pm1.66}$ & $39.74{\scriptstyle\pm1.86}$ \\ +WGF-DRO & $12.09{\scriptstyle\pm0.75}$ & $18.48{\scriptstyle\pm0.74}$ & $26.18{\scriptstyle\pm1.11}$ & $35.02{\scriptstyle\pm1.13}$ \\ +WFR-DRO & $11.10{\scriptstyle\pm0.60}$ & $\mathbf{17.31}{\scriptstyle\pm0.76}$ & $\mathbf{25.18}{\scriptstyle\pm0.88}$ & $\mathbf{34.06}{\scriptstyle\pm0.83}$ \\ + +\bottomrule +\end{tabular}% +} +\end{minipage} +\end{table*} + + +\begin{figure}[h!] + \centering + + \begin{subfigure}[b]{0.48\textwidth} + \centering + \includegraphics[width=\textwidth]{wfr_multi_sample_results.pdf} + \caption{Semantic transitions in the latent space} + \label{fig:wfr_latent} + \end{subfigure} + \hfill + \begin{subfigure}[b]{0.48\textwidth} + \centering + \includegraphics[width=\textwidth]{wfr_topk_comparison.pdf} + \caption{Comparison of sample diversity} + \label{fig:wfr_diversity} + \end{subfigure} + \caption{\textbf{Performance and diversity of the WFR sampler.} \textbf{(a)} Semantic transitions. Shown from left to right are the original images, intermediate samples at $T=100$ and $T=200$, and the final result at $T=300$. \textbf{(b)} Sample diversity comparison. The first column displays the original images, while the following three columns show the three highest-weighted samples generated at $T=300$. Unlike deterministic methods that are restricted to a single adversarial solution, the WFR sampler successfully generates multiple distinct samples from the conditional worst-case distribution.} + \label{fig:wfr_combined} +\end{figure} +\subsection{Human Face Classification} +\label{sec:exp_latent_wfr} + +In this section, we apply the WFR gradient flow sampler to the 512-dimensional latent space of a pre-trained ALAE \citep{pidhorskyi2020adversarial} model to investigate how the sampler identifies the worst-case distribution for high-dimensional image data. We employ a linear logistic regression classifier trained on the FFHQ dataset to classify gender attributes in the latent space; the gradient of this classifier then serves as the potential function. This experiment is qualitative: we use it to visually demonstrate the diversity of worst-case samples generated by the WFR sampler, complementing the quantitative robustness evidence in Sections~\ref{sec:lenet_mnist} and~\ref{sec:cifar_resnet}. + +The WFR sampler is configured with parameters $T=300$, $\eta = 0.05$, $\epsilon=0.2$, and $\tau=5$. As shown in Figure~\ref{fig:wfr_latent}, the sampler produces continuous semantic transitions while maintaining key identity details such as pose and expression. Unlike deterministic baselines such as WRM, which converge to a single adversarial solution, the WFR sampler generates diverse samples. This diversity is illustrated in Figure~\ref{fig:wfr_diversity}, where the top-3 weighted particles represent distinct stylistic variations for the same input, suggesting that the model effectively generates multiple plausible perturbations simultaneously. + + + +\section{Other Works and Discussion} + +Our work is positioned at the intersection of sampling via gradient flow and robust optimization. +There is a thread of works that considered the (D)RO problems via gradient descent-ascent dynamics \citep{wang2022exponentially,yuFastDistributionallyRobust2022,trillosAdversarialRobustnessUse2023,congerStrategicDistributionShift2023}. +They typically use proximal algorithms in the Wasserstein space \emph{iteratively}, i.e., the Jordan-Kinderlehrer-Otto (JKO) scheme in PDE , which can be viewed as one-step discretization of the continuous time PDE + $\partial_t \rho = \nabla \cdot \left( \rho \nabla \xi \right)$ for some $\xi$ . In this paper, we shift the perspective and view the inner maximization problem as a regularized variational problem that exactly corresponds to a sampling algorithm, without explicitly resorting to JKO iteratively. This allows our methodology to serve as a general-purpose sampler-based bi-level optimization framework \citep{nemirovski2009robust}, enabling a direct approach based on optimizing measures. + + +This perspective possesses significant unifying power: it reveals that previous methods such as WRM \citep{sinha2020certifyingdistributionalrobustnessprincipled} are fundamentally rooted in ODE analysis, which can be seen as a special case of the S/PDE framework proposed here. Our framework is also orthogonal to map-based approaches such as FlowDRO \citep{xu2024flow} and JKO-iterative analyses such as~\citet{zhu2024distributionally} (already discussed in Section~\ref{sec:intro}): we address DRO via a sampling methodology built on the equivalence between the inner problem and an entropy-regularized JKO step. This also allows optimizers to go beyond the standard (Wasserstein) gradient descent type of algorithm, inspiring novel approaches such as SVG and WFR gradient flows . Our theory treats general DRO by simply changing the corresponding gradient flow energy function $F$ in \eqref{eq:conditional-sampling-energy}, opening the door for future research into diverse DRO ambiguity notions and gradient flow dissipation geometries. + + + A practical SGDA-style variant of our framework is also possible. Instead of running the inner sampler to convergence, one can reuse the perturbed samples from the previous iteration and take only a few inner update steps before each outer parameter update. A full theoretical analysis of this SGDA variant is left to future work. + + + +\newpage + + + + + + + + + + + + + +\appendix +\onecolumn + + +\section{Further Background} + +\subsection{Dual approach to Entropy-regularized Wasserstein DRO} +\label{sec:dual-review} +The Sinkhorn DRO problem, as formulated by \citet{wang2021sinkhorn}, aims to find a decision that minimizes the worst-case expected loss over an ambiguity set defined by Sinkhorn divergence, which is identical to entropy-regularized Wasserstein distance in this problem. Given a loss function $\ell(\theta, z)$, a nominal distribution $\widehat{\rho_N}$, and a radius $r > 0$, the primal inner problem is: +\begin{equation} +\sup_{\rho\in \calB_{r, \epsilon}(\widehat{\rho_N})} \E_{z \sim \rho}[\ell(\theta, z)], +\label{eq:appendix-primal} +\end{equation} +where the ambiguity set is $\calB_{r, \epsilon}(\widehat{\rho_N}) := \{ \rho \in \calP(\calZ) : W_{\epsilon}^2(\widehat{\rho_N}, \rho) \le r \}$, and the entropy-regularized Wasserstein distance, +\[W^2_{\epsilon}(\rho_1, \rho_2) = \inf_{\gamma\in \Gamma(\rho_1,\rho_2)} \{\E_{(x,y)\sim\gamma}[c(x,y)] + H(\gamma)\}.\] + +A dual approach, established by \citet{wang2021sinkhorn}, reformulates the inner maximization problem. Using the strong duality of this problem and substituting \eqref{eq:worst-dist} into this problem, the inner problem can be expressed as a minimization over a dual variable $\tau$: +\begin{equation} +\inf_{\tau \ge 0} \left\{ \frac{r}{2\tau} +\frac{\epsilon}{2\tau} \E_{x\sim\widehat{\rho_N}} \left[ \log \E_{y\sim\rho_{x,\epsilon}} \left[ \exp\left(\frac{2\tau\ell(\theta, y)}{\epsilon}\right) \right] \right] \right\}, +\label{eq:appendix-dual} +\end{equation} +where $\rho_{x,\epsilon}(y) = \frac{\exp(\frac{-c(x,y)}{\epsilon})}{Z}$ is a kernel distribution centered at $x$, and $Z$ is a normalization constant. + +To approximate the value and the gradient of the nested expectation in \eqref{eq:appendix-dual}, \citet{wang2021sinkhorn} employ a two-level sampling procedure for a given $\tau$: first, a sample $x$ is drawn from the nominal distribution $\widehat{\rho_N}$; second, a set of samples are drawn from the kernel distribution $\rho_{x,\epsilon}$ to approximate the inner expectation. + +However, a major limitation of this dual method is that the nested expectation structure in the objective leads to a biased subgradient estimator when using standard Monte Carlo sampling, especially for small values of $\epsilon$. This bias can impede the convergence of the optimization procedure. This challenge motivates the exploration of alternative approaches, such as the gradient flow methods discussed in this paper, which can directly sample from the primal worst-case distribution to obtain a less biased estimate of the gradient. + +\begin{remark} + Consider the KL-DRO problem: + \begin{equation} + \min_\theta \sup_{\rho \ll \rho_0} \left\{ \mathbb{E}_{y \sim \rho}[\ell(\theta, y)] - \frac{1}{2\tau} \KL(\rho \| \rho_0) \right\} \label{eq:dro_objective_modified} + \end{equation} + Let us define a reference distribution $\rho_0(y)$ as a kernel density estimator of the empirical distribution $\widehat{\rho_N} = \frac{1}{N}\Sigma_{i=1}^N \delta(x_i)$: $\rho_0(y) = \frac{1}{N}\Sigma _{i=1}^N K_\epsilon(y,x_i)$, where $K_\epsilon(y,x_i)= \alpha_\epsilon \exp(-c(y,x_i)/\epsilon)$ and $\alpha_\epsilon = \E[\exp(-c(y,x_i)/\epsilon)]^{-1}$. With this choice, and by setting $\tau = \tau'/\epsilon$, the solution to the inner maximization problem is given by \citet{hu2013kullback}: + \begin{align*} + \rho^{\KL}(y) &= \rho_0(y) \cdot \frac{\exp(2\tau'\ell(\theta, y)/\epsilon)}{\mathbb{E}_{y \sim \rho_0}[\exp(2\tau'\ell(\theta, y)/\epsilon)]} \\ + &= \frac{1}{N}\Sigma _{i=1}^N \alpha_\epsilon \beta \exp((2\tau'\ell(\theta, y)- c(y,x_i))/\epsilon), + \end{align*} + where $\beta = \E_{y\sim \rho_0}[\exp(2\tau'\ell(\theta, y)/\epsilon)]^{-1}$. This resulting distribution bears a strong resemblance to the worst-case distribution for entropy-regularized DRO. However, they are not identical, as the normalization constants differ: $\alpha_\epsilon \beta \neq \alpha_x:= \E[\exp((2\tau'\ell(\theta, y)- c(y,x))/\epsilon]^{-1}$. In fact, the term $\alpha_\epsilon \beta \exp((2\tau'\ell(\theta, y)- c(y,x))/\epsilon)$ does not integrate to one and thus does not define a valid conditional probability measure. Actually, $\rho^{\KL}(y)$ can be interpreted as a weighted expectation of conditional distributions: + \[ + \rho^{\KL} = \E_{x\sim\widehat{\rho_N}}[\frac{\alpha_\epsilon \beta}{\alpha_x} \rho_{Y|X=x}] + \] + Consequently, the two-layer sampling procedure requires computing the corresponding weights, sampling from the resulting weighted empirical distribution, and subsequently sampling from the conditional distribution. However, the term $\alpha_x$ is intractable in practice. Therefore, unlike the entropy-regularized DRO case, the KL-DRO problem cannot be directly framed as a two-level sampling task. +\end{remark} + +\subsection{Hellinger-Kantorovich a.k.a. Wasserstein-Fisher-Rao Gradient Flows} + +Consider the WFR gradient system of the energy functional $F$, i.e., the triple $\left( \calP, F, \WFR \right)$, where $\WFR$ is the Wasserstein-Fisher-Rao metric, a.k.a. the \emph{Hellinger-Kantorovich} metric restricted to the probability space. +Specifically, we consider the HK/WFR gradient system associated with reaction-diffusion PDE: +\begin{align} + {\partial_t \rho} + &= \alpha\, \mathrm{div} \left( \rho \nabla \frac{\delta F}{\delta \rho} \right) - \beta\, \rho + \left(\frac{\delta F}{\delta \rho} - \int \frac{\delta F}{\delta \rho}\dd \rho \right) + . +\end{align} +The hope of this gradient flow is that the added reaction term on the right-hand side will help the gradient flow to converge more rapidly. +This can be formally seen by checking the time derivative of the energy functional $F$ along the gradient flow \eqref{eq:wfr-gradient-flow}, we have +\begin{align*} + \partial_t F (\rho_t) + \overset{\text{(EDB)}}{=} + -\alpha \int \Bigg|\nabla \log \frac{\rho}{\pi}(x) \Bigg| ^2\dd \rho (x) + -\beta \int \Bigg| \log \frac{\rho}{\pi}(x) + - + \KL(\rho | \pi) + \Bigg| ^2\dd \rho (x) + \end{align*} +where we used the Energy-Dissipation Balance (EDB, a.k.a. equality) of gradient flows. +We observe the right-hand side is non-positive, hence its dissipation will be faster than the original pure Wasserstein gradient flow. + +However, we must note that there is no global PL or strong convexity analogous to the case of the Wasserstein gradient flow, as discussed in the main text. +A ``warm-start'' condition is necessary as it has been shown that global PL/gradient dominance cannot hold for the Fisher-Rao/(spherical)Hellinger gradient flows; see \citet{mielke2025hellinger,carrillo2024fisher} for details. +There exist fine-grained warm-start initialization conditions in the gradient flow literature; see \citet{luBirthdeathDynamicsSampling2023,luAcceleratingLangevinSampling2019,chen2023sampling}. + +For example, \citet{luBirthdeathDynamicsSampling2023} +showed that, after a warm-start initialization in the form of a density-ratio lower bound, it is possible to get an improved exponential convergence rate +than the pure Wasserstein gradient flow as characterized in Lemma~\ref{lemma:gradient-dominance-PL-Wasserstein}. +However, it is important to note that +the specific warm-start initialization condition cannot be verified in our DRO problems. +Nonetheless, in practice, we observe significant speedups using the WFR gradient flow as compared to the pure Wasserstein gradient flow. + + +\section{Further Methods} + +\subsection{Wasserstein Fisher-Rao Gradient Flow-based DRO}\label{sec:wfr-alg} +This subsection details the DRO method based on the Wasserstein Fisher-Rao gradient flow. Algorithm \ref{alg:SDRO-WFR} provides a comprehensive summary of this procedure. Compared to the WGF-based method, this approach further refines the DRO framework by introducing birth-death mechanism. + + +The WFR gradient flow associated with the energy $F$ in \eqref{eq:conditional-sampling-energy} is governed by the reaction--diffusion PDE \eqref{eq:wfr-gradient-flow}. Discretizing it via interacting particles, each particle $(y^i, w^i)$ evolves through two coupled updates: a \emph{transport update} identical to ULA, and a \emph{reaction update} on the weights: +\begin{align*} +y^i_{t+1} &= y^i_t - \eta\,\nabla \widetilde V_{x,\tau}(y^i_t) + \sqrt{\eta\epsilon/\tau}\,\xi^i_t, &\textrm{(transport)}\\ +w^i_{t+1} &= (w^i_t)^{1-\epsilon\eta_w/(2\tau)}\cdot \exp\!\left(-\eta_w\, \widetilde V_{x,\tau}(y^i_t)\right). &\textrm{(reaction)} +\end{align*} +The reaction term increases or decrease the weights of particles based on their energy, low-energy particles gain mass, while high-energy ones lose mass. Once a particle's weight drops below a threshold $w_{\min}$, it is reborn at the location of a randomly selected surviving particle, with the two particles sharing the original mass equally. This birth--death mechanism prevents the wasted computation of tracking particles stuck in local minima, which we observe empirically in Figure~\ref{fig:perturbation_samples} of Appendix~\ref{sec:experiment3}. + +The full algorithm is summarized in Algorithm~\ref{alg:SDRO-WFR}. + +\begin{algorithm}[h!] +\caption{Entropy-regularized Wasserstein DRO via WFR flow} +\label{alg:SDRO-WFR} +\begin{algorithmic}[1] + \STATE {\bfseries Input:} Empirical distribution $\widehat{\rho_N}$, constraint set $\Theta$, $\tau, \epsilon >0$, stepsize sequence $\{r_s > 0\}_{s=0}^{S-1}$, inner stepsize $\eta$, weight stepsize $\eta_w$, weight threshold $w_{\text{min}}$, inner iterations $T$, number of samples $m$. + + \FOR{$s = 0, \dots, S-1$} + \STATE Sample $x^s \sim \widehat{\rho_N}$ + \STATE Initialize $y_{0}^{i,s} \leftarrow x^s, i=1,\dots,m$ + \FOR{$t = 0, \dots, T-1$} + \STATE Sample $\xi^{i,s}_t \sim\mathcal{N}(0,I)$ + \STATE $y_{t+1}^{i,s} \leftarrow y_{t}^{i,s} - \eta\nabla\widetilde V_{x^s, \tau}(y_{t}^{i,s}) + \sqrt{\eta\epsilon/\tau} \xi^{i,s}_t$ + \STATE $w_{t+1}^{i,s} \leftarrow (w_{t}^{i,s})^{1-\epsilon\eta_w/ (2\tau)}e^{-\eta_w \widetilde V_{x^s, \tau}(y_{t}^{i,s})}$ + \STATE Normalize weights: $w_{t+1}^{i,s} \leftarrow w_{t+1}^{i,s}/\sum_{j=1}^m w_{t+1}^{i,s}$ + + \STATE \textbf{Particle death/rejuvenation}: + \IF{$w_{t+1}^{i,s} < w_{\text{min}}$} + \STATE Uniformly select an index $i'$ from $\{j : j \neq i\}$. + \STATE $y_{t+1}^{i,s} \leftarrow y_{t+1}^{i',s}$, \, $w_{t+1}^{i',s}, w_{t+1}^{i,s}\leftarrow (w_{t+1}^{i,s} + w_{t+1}^{i',s})/2$. + \ENDIF + \ENDFOR + \STATE $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-r_s \sum_{i=1}^m w_{T}^{i,s}\nabla_\theta \ell(\theta^{s},y_{T}^{i,s}))$ + \ENDFOR + \STATE {\bfseries return} $\theta^S$ +\end{algorithmic} +\end{algorithm} +\subsection{Stein Variational Gradient-based DRO}\label{sec:svg} +Stein Variational Gradient Descent (SVGD) is a variational inference algorithm that approximates a target probability density $p(x)$ by iteratively transporting a set of particles $\{ x_i \}_{i=1}^n$ \citep{liu2016stein}. The method is formulated as a functional gradient descent on the Kullback-Leibler (KL) divergence, $\text{KL}(q||p)$, where $q$ represents the empirical distribution of the particles. The particle updates are governed by a velocity field $\phi(x_i)$ that corresponds to the direction of steepest descent. For an empirical measure of $n$ particles, this update is given by: +\begin{equation*} +\boldsymbol{\phi}(x_i) \propto \frac{1}{n} \sum_{j=1}^n \left[ k(x_j, x_i) \nabla_{x_j} \log p(x_j) + \nabla_{x_j} k(x_j, x_i) \right] +\end{equation*} +This update rule can be decomposed into two functional components: (i) a driving force, which is a kernel-smoothed average of the score function $\nabla \log p(x)$ that directs particles towards the modes of the target distribution, and (ii) a repulsive force, which arises from the kernel gradient $\nabla k(\cdot, \cdot)$ and ensures particle diversity to prevent mode collapse \citep{ba2021understanding}. + +The iterative application of this update rule forms the basis of the SVGD algorithm. As detailed in \citep{liu2016stein}, its computational complexity is dominated by the pairwise kernel computations, resulting in a cost of $O(m^2d)$ per iteration for $m$ particles in $d$ dimensions. Regarding convergence, theoretical guarantees have been established under certain assumptions. As shown by \citep{salim2022convergence}, for target distributions that satisfy Talagrand's T1 inequality, a finite-iteration complexity bound is derived. A finite-particle convergence analysis is also provided in \citep{shi2023finite}. + +By applying SVGD to sample from the worst-case distribution, we arrive at Algorithm \ref{alg:SDRO-SVG}. + +\begin{algorithm}[tb] +\caption{Sinkhorn DRO via SVGD} +\label{alg:SDRO-SVG} +\begin{algorithmic}[1] + \STATE {\bfseries Input:} Empirical distribution $\widehat{\rho_N}$, constraint set $\Theta$, $\tau, \epsilon >0$, stepsize sequence $\{r_s > 0\}_{s=0}^{S-1}$, inner stepsize $\eta$, inner iterations $T$, initial deviation $\sigma$, number of samples $m$. + + \FOR{$s = 0, \dots, S-1$} + \STATE Sample $x^s \sim \widehat{\rho_N}$ + \STATE Sample $\xi^{s,i}\sim\mathcal{N}(0,\sigma I) ,\, i=1,\dots,m$ + \STATE Initialize $y^{s,i}_0 \leftarrow x^s + \xi^{s,i}$ + \FOR{$t = 0, \dots, T-1$} + \STATE $\phi^{s,i}_t \leftarrow \frac{1}{m}\sum_{j=1}^m\left[-k(y^{s,i}_t, y^{s,j}_t)\cdot \frac{2\tau}{\epsilon}\nabla\widetilde V_{x^s, \tau}(y^{s,j}_t) + \nabla_2 k(y^{s,i}_t, y^{s,j}_t) \right]$ + \STATE $y^{s,i}_{t+1}\leftarrow y^{s,i}_t + \eta \phi^{s,i}_t$ + \ENDFOR + \STATE $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-r_s \sum_{i=1}^m \frac{1}{m}\nabla_\theta \ell(\theta^{s},y^{s,i}_T))$ + \ENDFOR + \STATE {\bfseries return} $\theta^S$ +\end{algorithmic} +\end{algorithm} + +However, the empirical performance of Algorithm~\ref{alg:SDRO-SVG} is suboptimal. We observe that the convergence is sensitive to the initialization of the particles. Furthermore, when the number of particles $m$ is small, the magnitude of the driving force to dominate the repulsive force, thereby diminishing the variance. In this regime, the SVGD algorithm degenerates into a simple gradient descent method, losing its sampling capabilities. This behavior is demonstrated empirically in Appendix~\ref{sec:experiment3}. + + +\subsection{Restricted Gaussian Oracle-based DRO}\label{sec:rgo} + +In this section, we explore an alternative approach for sampling from the worst-case distribution based on Proximal Sampler. The \textit{Proximal Sampler} \citep{lee2021structured} was introduced to unbiasedly sample from Gibbs distributions of the form $\nu(x) \propto \exp(-f(x))$. A single iteration of the proximal sampler consists of the following two steps: +\begin{enumerate} + \item (\textbf{Forward step}): Sample $y_k \mid x_k \sim \nu_\tau^{Y|X}(\cdot \mid x_k) = \mathcal{N}(x_k, \tau I)$. This results in a new iterate $y_k \sim \rho^Y_k$, where $\rho^Y_k = \rho^X_k * \mathcal{N}(0, \tau I)$. + \item (\textbf{Backward step}): Sample $x_{k+1} \mid y_k \sim \nu_\tau^{X|Y}(\cdot \mid y_k)$. This gives the next iterate $x_{k+1} \sim \rho^X_{k+1}$. +\end{enumerate} + + +As shown in recent work \citep{chen2022improved}, this forward-backward procedure is equivalent to an entropy-regularized Jordan-Kinderlehrer-Otto (JKO) scheme : +\begin{align}\label{eq:forward_app} + \rho_k^Y &= \arg\min_{\mu \in P_2(\mathbb{R}^d)} \left\{ \frac{1}{2\tau} W^2_{2\tau}(\rho_{k}^{X}, \mu) \right\}, \\ + \rho_{k+1}^{X} &= \arg\min_{\mu \in P_2(\mathbb{R}^d)} \left\{ \int f \, d\mu + \frac{1}{2\tau} W^2_{2\tau}(\rho_{k}^{Y}, \mu) \right\}, \label{eq:backward_app} +\end{align} +This connection to the entropy-regularized JKO scheme provides a new perspective to our problem. By reformulating our original Lagrangian problem (\eqref{eq:main-ent-dro}) as a minimization and specializing the cost to the squared Euclidean distance, we obtain: +\begin{equation}\label{pb:sinkhornscheme_modified} + \Phi(\theta)=\min_{\rho\in\calP} \{\E_{y\sim\rho}[-\ell(\theta, y)] + \frac{1}{2\tau} W^2_{\epsilon}(\rho,\widehat{\rho_N})\}, +\end{equation} +which precisely matches the form of the problem \eqref{eq:backward_app} solved by backward step. This structural equivalence suggests that methods developed for proximal sampler can be directly applied to solve the entropy-regularized DRO problem. Specifically, we can employ the \textit{Restricted Gaussian Oracle (RGO)} from \citet{lee2021structured} to solve this. The sampling process for a given $x \sim \widehat{\rho_N}$ involves two steps: +\begin{enumerate}\label{alg:rejection-sampling} + \item Sample $x$ from $\widehat{\rho_N}$, and compute the minimizer \( y^*_{x, \tau} = \arg\min_{y \in \mathbb{R}^d} \{\widetilde V_{x, \tau}(y)\} \). + \item Repeat until acceptance: draw a sample \( Z \sim \mathcal{N} \left( y^*_{x, \tau}, \frac{\epsilon}{2(1 - L\tau)} I \right) \) and accept it with probability + \[ + \exp \left(- \widetilde V_{x, \tau}(Z) +\widetilde V_{x, \tau}(y^*_{x, \tau}) + \frac{2(1 - L\tau)}{\epsilon} \| Z - y^*_{x, \tau} \|^2 \right). + \] +\end{enumerate} + + +The validity of the RGO sampler requires the loss function $\ell$ to be $L$-smooth, and the penalty parameter $\tau$ must satisfy $\tau < 1/L$. This condition ensures that the auxiliary function $\widetilde V_{x, \tau}(y)$ is $(\frac{2(1-L\tau)}{\epsilon})$-strongly convex, which is crucial for rejection sampling. Applying RGO to the entropy-regularized DRO problem necessitates that the loss function is $L$-smooth and requires solving a convex optimization subproblem in each step. These requirements on the loss function and the computational structure are analogous to the WRM algorithm presented in \citep{sinha2020certifyingdistributionalrobustnessprincipled} for the specific case of a squared Euclidean cost. However, a key difference exists: the WRM algorithm transports each data point to a single worst-case point, whereas in entropy-regularized DRO, each data point induces a full continuous distribution of worst-case scenarios. +\begin{algorithm}[tb] +\caption{Sinkhorn DRO via RGO} +\label{alg:SDRO_rgo} +\begin{algorithmic}[1] + \STATE {\bfseries Input:} Empirical distribution $\widehat{\rho_N}$, constraint sets $\Theta$, $\tau, \epsilon > 0$, stepsize sequence $\{r_s > 0\}^{S-1}_{s=0}$ + + \FOR{$s = 0, \dots, S-1$} + \STATE Sample $x^s \sim \widehat{\rho_N}$ and find an $\eta$-approximate minimizer $\hat{y}^s$ of $\widetilde{V}_{\tau,x^s}(y)$ + \STATE Generate samples $\{y^{s,i}\}_{i=1}^m$ via rejection sampling + \STATE $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-\frac{r_s}{m}\sum^m_{i=1} \nabla_\theta \ell(\theta^{s}, y^{s,i}))$ + \ENDFOR + \STATE {\bfseries return} $\theta^S$ +\end{algorithmic} +\end{algorithm} + + +\begin{remark} +Although WRM\citep{sinha2020certifyingdistributionalrobustnessprincipled} assumes an $L$-smooth loss, its algorithm is “parameter-free” – it never needs to know $L$ and works whenever the inner optimization problem admits a closed-form solution. In contrast, Algorithm \ref{alg:SDRO_rgo} requires explicit knowledge of $L$ and cannot be applied if the loss fails to be $L$-smooth. In practice, we may assume $\tau$ is sufficiently small such that $\tau < 1/L$, and $\ell$ is $L$-smooth for all $y$. +\end{remark} + + +\section{Proofs of Theoretical Results} \label{ap:complexity_proofs} + +\subsection{Proof of Proposition \ref{lem:sb-klform}} +\begin{proof}[Proof of Proposition \ref{lem:sb-klform}] + We rewrite the problem using the definition of the entropy-regularized OT formulation: + \begin{align} + \min_{\rho} \min _{\Pi} + \biggl\{ + \int V \dd \rho + \frac{1}{2\tau } + \int c(x,y) \dd\Pi + \frac\epsilon{2\tau}\int \log \Pi \dd\Pi + \biggr\} + \end{align} + subject to the margianl constraints $\int \Pi \dd x = \rho$ and $\int \Pi \dd y = \rho_0$. + Here, + $\rho_0$ can be set to empirical distribution $\widehat{\rho_N}$ as in the data-driven DRO problem. + Using the marginal constraints, + we can then write the first linear term as + $\int \int V(y) \dd \Pi(x, y)$ and eliminate the variable $\rho$, i.e., one end is unconstrained -- hence it's the half bridge problem: + \begin{align} + \min _{\Pi} + \biggl\{ + \int V \dd \Pi + \frac{1}{2\tau } + \int c(x,y) \dd\Pi + \frac\epsilon{2\tau}\int \log \Pi \dd\Pi + \, \, + \bigg | + \int \Pi \dd y = \rho_0 + \biggr\} + . + \end{align} + After straightforward linear optimization, + we obtain the optimal solution to the variational problem~\eqref{eq:proximal-EOT} as + \begin{align} + \rho^*(y) = \E_{x\sim \rho_0} \left[ + \frac{1}{Z_x}\exp + \left[{-\frac{2\tau V(y) +c(y, x) }{\epsilon}} \right] + \right],\quad Z_x = \int \exp\!\left[-\frac{2\tau V(y)+c(y,x)}{\epsilon}\right]\dd y. + \end{align} + Using elementary manipulations, the variational problem \eqref{eq:proximal-EOT} + can also be written down as the minimization of the expected KL divergence: + \begin{align} + \min_{\rho_{Y|X}} + \mathbb{E}_{x\sim\rho_0} + \KL + \left( + \rho_{Y|X=x}(y) + \bigg| + \dfrac{1}{Z_x} + \exp \left[ + -\dfrac{2\tau V(y) + c(y,x)}{\epsilon} + \right] + \right) + . + \end{align} +\end{proof} + +\subsection{Proof of Proposition~\ref{prop:gradient_oracle_error_control}} +First, we recall some standard results. +\begin{lemma} + \label{lemma:displacement-convexity} + Suppose the first condition in Definition~\ref{as:gf-properties} holds for some $\lambda > 0$. Then, + $F$ is $\lambda$-displacement convex. +\end{lemma} + +\begin{lemma}[WGF gradient dominance/PL] + \label{lemma:gradient-dominance-PL-Wasserstein} + Let $\rho_t$ be a solution to the Wasserstein gradient flow of the KL divergence energy functional $\KL(\rho | \exp(-\widetilde V_{x, \tau}))$. Then, +\begin{align*} + \text{$\widetilde V$ is $\lambda$-displacement convex or $\lambda$-PL} + \implies + \KL(\rho_t| \exp(-\widetilde V_{x, \tau})) + \leq + \ee^{-2\lambda t} \KL(\rho_0| \exp(-\widetilde V_{x, \tau})). +\end{align*} +\end{lemma} + +\begin{lemma}[Talagrand's inequality] + Under the same assumptions as in Lemma \ref{lemma:gradient-dominance-PL-Wasserstein}, we have + \label{lemma:talagrand-inequality} +\[ +W_2^2(\rho_t, \exp(-\widetilde V_{x, \tau})) \leq +\sqrt{\frac2\lambda \KL(\rho_t | \exp(-\widetilde V_{x, \tau}))} +\] +\end{lemma} +Recall also that $W_1(\rho_t, \pi_{Y|X=x}) \leq W_2(\rho_t, \pi_{Y|X=x})$. + + +\textbf{From conditional to marginal bound} +We have the following relation between the marginal and conditional KL divergences. +Suppose $\rho_X$ is the marginal distribution of $X$. +Recall the relation $\pi_Y = \int_x \rho^* _{Y|X=x} \dd \rho_X(x)$. +Then, +\[ +\KL(\rho_Y | \pi_{Y}) \leq \mathbb{E}_{X \sim \rho_X} \left[ \KL\left(\rho_{Y|X} \middle| \pi_{Y|X}\right) \right]. +\] + +Alternatively, the Wasserstein relation gives +\[ +W_p(\rho_Y, \pi_Y) \leq \mathbb{E}_{X \sim \rho_X} \left[ W_p(\rho_{Y|X}(\cdot|X), \pi_{Y|X}(\cdot|X)) \right]. +\] + +\textbf{Marginal distribution error control} +Suppose we have the samples +$y^i_t\sim \rho_{t,Y}$, +Our goal is to use the empirical measure +$\displaystyle\widehat{\rho_{t,Y}} = \frac1N \sum_{i=1}^N \delta_{y^i_t}$ +to approximate $\pi_Y$. + +Taking expectations and applying the triangle inequality, we have +\begin{align} + \mathbb{E}[W_1(\widehat{\rho_{t,Y}}, \pi_Y)] + &\leq \mathbb{E}[W_1(\widehat{\rho_{t,Y}}, \rho_{t,Y})] + W_1(\rho_{t,Y}, \pi_Y), + \label{eq:marginal_w1_decomp} +\end{align} +where the first term is from particle approximation, which vanishes as $N\to\infty$. And the second term is the optimization error along the gradient flow. By Lemma~\ref{lemma:gradient-dominance-PL-Wasserstein} and Lemma~\ref{lemma:talagrand-inequality}, together with the conditional-to-marginal Wasserstein bound, +\begin{align} + W_1(\rho_{t,Y}, \pi_Y) + &\leq \mathbb{E}_{X \sim \rho_X} \left[ W_2(\rho_{t,Y|X}, \pi_{Y|X}) \right] + \lesssim + \frac{{\ee^{-\lambda t}}}{\sqrt{\lambda}}. + \label{eq:marginal_w1_decay} +\end{align} + +Therefore, to reach a $\delta_\text{sample}$-solution in expectation, we need to run the gradient flow (i.e. simulating the PDE/SDE) for time +\begin{align} + t \gtrsim \frac{1}{\lambda}\log{\frac1{\sqrt{\lambda}\delta_\text{sample}}} + . + \label{eq:gf_time_to_epsilon} +\end{align} + +We will later show the discrete-time gradient descent version of this result. + +We emphasize that the continuous-time gradient flow result is important not only for understanding the limit of discrete-time algorithms, but also for serving as a guide for designing new discrete-time algorithms. +Let us get a quick insight from the above estimate: +suppose we discretized algorithm with discretization stepsize $\eta$ for in total $T$ steps. Ignoring the discretization error, we have $t = T\eta$ and the (ideal) number of iterations needed to reach a $\delta_\text{sample}$-solution +of the inner maximization problem~\eqref{eq:entropic-jko} +is $T \gtrsim \frac{1}{\eta \lambda}\log{\frac1{\sqrt{\lambda}\delta_\text{sample}}}$. + +\textbf{DRO gradient oracle error control via gradient flow} +Let us now show how to convert the error estimate in distributions to the error estimate in the gradient oracle, needed for the optimization analysis later. +If $\mathbb{E}[W_1(\widehat{\rho_{t,Y}}, \pi_Y)] \leq \delta_\text{sample}$ for some $\delta_\text{sample} > 0$ (as controlled by \eqref{eq:marginal_w1_decay}) and $g$ is $L$-Lipschitz (w.r.t. Euclidean norm). +Then, + by Kantorovich--Rubinstein duality \citep{kantorovich1942translocation}, +we obtain: +\begin{align} + \label{eq:gradient_oracle_error_control_expectation} + \mathbb{E}\!\left[\, \left| \int g\, d(\widehat{\rho_{t,Y}} - \pi_Y) \right| \,\right] +\leq L \cdot\mathbb{E}[W_1(\widehat{\rho_{t,Y}}, \pi_Y)] +\leq L\delta_\text{sample}. +\end{align} + +In the optimization analysis, we can later take $g$ to be the gradient oracle of the DRO loss, $g:=\nabla_\theta \ell(\theta, \cdot)$, to control the gradient oracle error. +Recall that $\widehat{\rho_{t,Y}} = \frac1N \sum_{i=1}^N \delta_{y^i_t}$ is the particle approximation obtained by running the gradient flow sampler for $t$ steps, and $\pi_Y$ is the target marginal distribution, which is the worst-case distribution of DRO inner maximization problem~\eqref{eq:entropic-jko}. +Then, +\eqref{eq:gradient_oracle_error_control_expectation} results in the following +bound on the gradient oracle error: +\begin{multline} + \label{eq:gradient_oracle_error_control} + \mathbb{E}\!\left[\, \bigg|\frac1N \sum_{i=1}^N \nabla_\theta \ell(\theta, y^i_t) +- +\nabla_\theta +\underbrace{ +\max _{\rho \in \calP} +\biggl( + \int \ell(\theta, z)\dd\rho{(z)} + -\frac1{2\tau} W_\epsilon^2(\rho, \widehat{\rho_N}) +\biggr) +}_{\text{DRO objective}} +\bigg| \,\right] +\\ += + \mathbb{E}\!\left[\, \bigg|\frac1N \sum_{i=1}^N \nabla_\theta \ell(\theta, y^i_t) +- +\mathbb{E}_{y \sim \pi_Y} +\nabla_\theta\ell(\theta, y) +\bigg| \,\right] +\overset{\eqref{eq:gradient_oracle_error_control_expectation}}{\leq} +L\delta_\text{sample} +\end{multline} + +Replacing $L\delta_\text{sample}$ by $\epsilon_\text{grad}$, we obtain the desired bound on the gradient oracle error as in Proposition~\ref{prop:gradient_oracle_error_control}. + + +\subsection{Proof of Theorem \ref{thm:outer_loop} (Outer Loop Convergence)} +\label{ap:proofth1} +We provide a detailed proof for the convergence of the outer loop, which follows the standard analysis for non-convex Stochastic Gradient Descent with a persistent bias. + +\begin{lemma}[Bias of the Stochastic Gradient] +\label{lem:bias_grad} +Under Assumptions \ref{as:global_assumptions}.\ref{as:fsmooth}, \ref{as:global_assumptions}.\ref{as:gradest}, the bias of the stochastic gradient estimator, defined as $B(\theta) := \E_{} [\widehat g] - \nabla\Phi(\theta)$, is bounded as: +$$\|B(\theta)\| \le L_f \cdot \delta_{\text{sample}}.$$ +\end{lemma} +\begin{proof} +By definition, the bias is +\begin{align*} + B(\theta) &= \E_{x \sim \widehat{\rho_N}}\left[\E_{y \sim \widehat\rho_{Y|X=x}}[\nabla_\theta \ell(\theta, y)]\right] - \E_{x \sim \widehat{\rho_N}}\left[\E_{y \sim \pi_{Y|X=x}}[\nabla_\theta \ell(\theta, y)]\right] \\ + &= \E_{x \sim \widehat{\rho_N}}\left[ \E_{y \sim \widehat\rho_{Y|X=x}}[\nabla_\theta \ell(\theta, y)] - \E_{y \sim \pi_{Y|X=x}}[\nabla_\theta \ell(\theta, y)] \right]. +\end{align*} +Taking norms and using Jensen's inequality: +$$\|B(\theta)\| \le \E_{x \sim \widehat{\rho_N}}\left[ \| \E_{y \sim \widehat\rho_{Y|X=x}}[\nabla_\theta \ell(\theta, y)] - \E_{y \sim \pi_{Y|X=x}}[\nabla_\theta \ell(\theta, y)] \| \right].$$ + By Assumption~\ref{as:global_assumptions}.\ref{as:fsmooth}, the map $y \mapsto \nabla_\theta \ell(\theta, y)$ is $L_f$-Lipschitz in $y$. Hence by Kantorovich--Rubinstein duality, for any two probability measures $\rho_1, \rho_2$ with finite first moment, +\[\big\|\E_{y\sim\rho_1}[\nabla_\theta \ell(\theta, y)] - \E_{y\sim\rho_2}[\nabla_\theta \ell(\theta, y)]\big\| \le L_f \cdot W_1(\rho_1, \rho_2).\] +Applying this and using $W_1 \le W_2$, we obtain +\begin{align*} + \|B(\theta)\| &\le \E_{x \sim \widehat{\rho_N}}\left[ L_f \cdot W_1(\widehat\rho_{Y|X=x}, \pi_{Y|X=x}) \right] \\ + &\le L_f \cdot \E_{x \sim \widehat{\rho_N}}\left[ W_2(\widehat\rho_{Y|X=x}, \pi_{Y|X=x}) \right] \quad (\text{since } W_1 \le W_2) \\ + &\le L_f \cdot \delta_{\text{sample}}. +\end{align*} +\end{proof} + +\noindent\textbf{Proof of Theorem \ref{thm:outer_loop}.} +From the $L_\Phi$-smoothness of $\Phi$ (Assumption \ref{as:global_assumptions}.\ref{as:totalsmooth}), we have the standard descent lemma. For simplicity, we assume $\Theta = \mathbb{R}^d$ and a constant stepsize $r_s = r$. +\begin{align*} + \Phi(\theta^{s+1}) &\le \Phi(\theta^s) + \langle \nabla\Phi(\theta^s), \theta^{s+1} - \theta^s \rangle + \frac{L_\Phi}{2}\|\theta^{s+1} - \theta^s\|^2 \\ + &= \Phi(\theta^s) - r \langle \nabla\Phi(\theta^s), \widehat g^s \rangle + \frac{L_\Phi r^2}{2}\|\widehat{g}^s\|^2. +\end{align*} +Taking expectation conditioned on the filtration $\mathcal{F}_s$: +\begin{align*} + \E[\Phi(\theta^{s+1})|\mathcal{F}_s] &\le \Phi(\theta^s) - r \langle \nabla\Phi(\theta^s), \E[\widehat{g}^s|\mathcal{F}_s] \rangle + \frac{L_\Phi r^2}{2}\E[\|\widehat{g}^s\|^2|\mathcal{F}_s] \\ + &= \Phi(\theta^s) - r \langle \nabla\Phi(\theta^s), \nabla\Phi(\theta^s) + B(\theta^s) \rangle + \frac{L_\Phi r^2}{2} \left( \|\E[\widehat{g}^s|\mathcal{F}_s]\|^2 + \text{Var}(\widehat{g}^s|\mathcal{F}_s) \right). +\end{align*} +Using the variance bound and the bias definition: +\begin{align*} + \E[\Phi(\theta^{s+1})|\mathcal{F}_s] &\le \Phi(\theta^s) - r\|\nabla\Phi(\theta^s)\|^2 - r\langle \nabla\Phi(\theta^s), B(\theta^s) \rangle + \frac{L_\Phi r^2}{2} \left( \|\nabla\Phi(\theta^s)+B(\theta^s)\|^2 + \sigma^2 \right). +\end{align*} +Applying Young's inequality to the inner product term: +$$-r\langle \nabla\Phi(\theta^s), B(\theta^s) \rangle \le \frac{r}{2}\|\nabla\Phi(\theta^s)\|^2 + \frac{r}{2}\|B(\theta^s)\|^2.$$ +Substituting this in and simplifying with $\|a+b\|^2 \le 2\|a\|^2 + 2\|b\|^2$: +$$\E[\Phi(\theta^{s+1})|\mathcal{F}_s] \le \Phi(\theta^s) - \frac{r}{2}\|\nabla\Phi(\theta^s)\|^2 + \frac{r}{2}\|B(\theta^s)\|^2 + L_\Phi r^2 (\|\nabla\Phi(\theta^s)\|^2 + \|B(\theta^s)\|^2) + \frac{L_\Phi r^2 \sigma^2}{2}.$$ +Rearranging terms to isolate $\|\nabla\Phi(\theta^s)\|^2$: +$$r\left(\frac{1}{2} - L_\Phi r\right)\|\nabla\Phi(\theta^s)\|^2 \le \Phi(\theta^s) - \E[\Phi(\theta^{s+1})|\mathcal{F}_s] + \left(\frac{r}{2} + L_\Phi r^2\right)\|B(\theta^s)\|^2 + \frac{L_\Phi r^2 \sigma^2}{2}.$$ +Choosing a stepsize $r \le \frac{1}{4L_\Phi}$, we have $(\frac{1}{2} - L_\Phi r) \ge \frac{1}{4}$ and $(\frac{r}{2} + L_\Phi r^2) \le r$. This gives: +$$\frac{r}{4}\|\nabla\Phi(\theta^s)\|^2 \le \Phi(\theta^s) - \E[\Phi(\theta^{s+1})|\mathcal{F}_s] + r\|B(\theta^s)\|^2 + \frac{L_\Phi r^2 \sigma^2}{2}.$$ +Taking total expectation and using Lemma~\ref{lem:bias_grad}, $\|B(\theta^s)\|^2 \le (L_f \delta_{\text{sample}})^2$: +$$\frac{r}{4}\E[\|\nabla\Phi(\theta^s)\|^2] \le \E[\Phi(\theta^s)] - \E[\Phi(\theta^{s+1})] + r (L_f \delta_{\text{sample}})^2 + \frac{L_\Phi r^2 \sigma^2}{2}.$$ +Summing from $s=0$ to $S-1$ yields a telescoping sum: +$$\frac{r}{4}\sum_{s=0}^{S-1}\E[\|\nabla\Phi(\theta^s)\|^2] \le \Phi(\theta^0) - \E[\Phi(\theta^S)] + Sr(L_f \delta_{\text{sample}})^2 + \frac{S L_\Phi r^2 \sigma^2}{2}.$$ +Dividing by $\frac{r S}{4}$ and using $\E[\Phi(\theta^S)] \ge \Phi_{\inf}$: +$$\frac{1}{S}\sum_{s=0}^{S-1}\E[\|\nabla\Phi(\theta^s)|^2] \le \frac{4(\Phi(\theta^0) - \Phi_{\inf})}{r S} + 4(L_f \delta_{\text{sample}})^2 + 2L_\Phi r \sigma^2. $$ + +Therefore, when $\delta_{\text{sample}}$ is controlled such that $\delta_{\text{sample}}= O(\epsilon_\text{opt}/L_f)$, and step size $r = \sqrt \frac{1}{SL_\Phi\sigma^2}$, and the iteration $S=O(1/\epsilon_\text{opt}^4)$, $\frac{1}{S}\sum_{s=0}^{S-1}\E[\|\nabla\Phi(\theta^s)|^2] \le O(\epsilon_\text{opt}^2)$. + + + + +\subsection{Derivation of ULA Sampler Complexity (for Theorem~\ref{thm:ula})} +\label{ap:ula_derivation} +The complexity of the ULA sampler depends on the geometric properties of the inner target distribution $\pi_{Y|X=x}$. +Under Assumption \ref{as:LSI}, standard results on ULA convergence \citep{vempala2019rapid} state that after $T$ steps, the KL-divergence to the target is bounded. To achieve a final KL-divergence of $\delta_{KL}$, the number of iterations required is $T = O\left(\frac{L_U^2 d}{\lambda_U^2 \delta_{KL}}\log \frac{1}{\delta_{KL}}\right) = \tilde{O}\left(\frac{L_U^2 d}{\lambda_U^2 \delta_{KL}}\right)$. + +Our goal is to connect the required outer-loop sampling accuracy $\delta_{\text{sample}}$ (in $W_2$ distance) to the required inner-loop KL-divergence accuracy $\delta_{KL}$. Under the LSI assumption, Talagrand's inequality gives the relationship: +$$ W_2^2(\widehat \rho_{Y|X=x} , \pi_{Y|X=x}) \le \frac{2}{\lambda_U} \KL(\widehat \rho_{Y|X=x} || \pi_{Y|X=x}) $$ +From Theorem \ref{thm:outer_loop}, we require $W_2(\widehat \rho_{Y|X=x}, \pi_{Y|X=x}) \le \delta_{\text{sample}} = O(\epsilon_{\text{opt}}/L_f)$. This implies we need to achieve a KL-divergence of: +$$ \delta_{KL} \le \frac{\lambda_U}{2} W_2^2(\widehat \rho_{Y|X=x}, \pi_{Y|X=x}) = O\left(\lambda_U \frac{\epsilon_{\text{opt}}^2}{L_f^2}\right). $$ +Substituting this required $\delta_{KL}$ into the ULA iteration complexity gives the number of inner loop steps: +$$ T_{ULA} = \tilde{O}\left(\frac{L_U^2 d}{\lambda_U^2 \cdot \lambda_U \frac{\epsilon_{\text{opt}}^2}{L_f^2}}\right) = \tilde{O}\left(\frac{L_U^2 L_f^2 d}{\lambda_U^3 \epsilon_{\text{opt}}^2}\right). $$ +The total complexity is the product of outer iterations $S = O(1/\epsilon_{\text{opt}}^4)$, inner iterations $T_{ULA}$, and the cost per inner gradient step $C_{\nabla_z} = O(d)$. +\begin{align*} +\text{Complexity} &= S \times T \times C_{\nabla_{z}} \\ +&= O\left(\frac{1}{\epsilon_{\text{opt}}^{4}}\right) \times \tilde{O}\left(\frac{L_U^2 L_f^2 d}{\lambda_U^3 \epsilon_{\text{opt}}^2}\right) \times O(d) \\ +&= \tilde{O}\left(\frac{L_U^2 L_f^2 d^2}{\lambda_U^3 \epsilon_{\text{opt}}^6}\right). +\end{align*} +Note that we absorb constants like $L_{\Phi}$ into the $\tilde{O}(\cdot)$ notation. This completes the derivation for Theorem \ref{thm:ula}. + + + +\subsection{Complexity of RGO} +We analyze the computational complexity of RGO method under specific regularity conditions on the loss function. + +\begin{theorem}[Complexity of RGO Sampling] +\label{thm:rgo_complexity} +Let the loss function $\ell: \mathbb{R}^d \to \mathbb{R}$ be $L$-smooth. For parameter $\tau = \frac{1}{Ld}$ and a target distribution $\pi_{Y|X=x}$, through the rejection sampling procedure described in Appendix~\ref{sec:rgo}, we can draw a sample from a distribution $\tilde{\rho}_{Y|X=x}$ such that the Kullback-Leibler (KL) divergence satisfies $\KL(\tilde{\rho}_{Y|X=x} \,\Vert\, \pi_{Y|X=x}) < \delta$ with iteration complexity (where $\epsilon$ is the entropy regularization parameter from~\eqref{eq:main-ent-dro}) +\[ O\!\left(\log\!\left(\frac{1}{\epsilon\delta}\right)\right). \] +\end{theorem} + +\begin{proof} +Under the assumption that $\ell$ is $L$-smooth and $\tau < \frac{1}{L}$, $\widetilde V_{x, \tau}(y)$, is $\frac{2-2\tau L}{\epsilon}$-strongly convex and $\frac{2+2\tau L}{\epsilon}$-smooth. + +Let the minimizer of $\widetilde V_{x, \tau}(y)$ as $y^*_{x, \tau}$. To find the minimum of $\widetilde V_{x, \tau}(y)$, we can apply gradient descent. The number of iterations required to achieve a $\delta'$-approximate optimal solution $\tilde{y}$ is determined by the condition number $\kappa = \frac{1+\tau L}{1-\tau L}$. Specifically, the iteration complexity is: +$$ O\left(\kappa \log\left(\frac{1}{\delta'}\right)\right) = O\left(\frac{1+\tau L}{1-\tau L}\log\left(\frac{1}{\delta'}\right)\right) $$ + + +\textbf{2. Distributional Proximity.} +Let the distribution obtained via rejection sampling with a $\delta'$-approximate optimal solution for the proposal be denoted by $\tilde{\rho}_{Y|X=x}$. The procedure defines the proposal distributions $p(y)$ (using the true minimizer $y^*_{x,\tau}$) and $\tilde{p}(y)$ (using the approximate minimizer $\tilde{y}$) as Gaussian distributions: +\[ p(y) = \mathcal{N} \left( y \mid y^*_{x,\tau}, \frac{\epsilon}{2 - 2\tau L} I \right), \quad \tilde{p}(y) = \mathcal{N} \left( y \mid \tilde{y}, \frac{\epsilon}{2 - 2\tau L} I \right) \] +The corresponding acceptance probabilities $a(y)$ and $\tilde{a}(y)$ are given by: +\begin{align*} + a(y) &= \exp \left( - \widetilde V_{x, \tau}(y) + \widetilde V_{x, \tau}(y^*_{x,\tau}) + \frac{1 - \tau L }{\epsilon} \| y - y^*_{x,\tau} \|^2 \right) \\ + \tilde{a}(y) &= \min\left\{\exp \left( - \widetilde V_{x, \tau}(y) + \widetilde V_{x, \tau}(\tilde{y}) + \frac{1 - \tau L }{\epsilon} \| y - \tilde{y} \|^2 \right), 1\right\} +\end{align*} +The resulting KL divergence from the distribution obtained with the true minimizer, $\rho_{\theta,x}$, is +\begin{align} + \KL(\tilde{\rho}_{Y|X=x}||\pi_{Y|X=x}) &= \int \frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)} \log \left(\frac{\frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)}}{\frac{a(y)p(y)}{\int a(y)p(y)}}\right) dy\\ + &= \int \frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)} \left(\log \left(\frac{\tilde{a}(y)\tilde{p}(y)}{a(y)p(y)}\right) + \log\left(\frac{\int a(y)p(y)}{\int \tilde{a}(y)\tilde{p}(y) }\right) \right) dy + \\ + &\leq\int \frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)}\cdot 2 \left(\widetilde V_{x, \tau}(\tilde{y})-\widetilde V_{x, \tau}(y^*_{x, \tau}) \right) dy + \\ + &\leq\int \frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)}\cdot \frac{4+4\tau L}{\epsilon} \delta' dy + = \frac{4+4\tau L}{\epsilon}\delta' +\end{align} + +To ensure the final KL divergence is less than $\delta$, we must set the optimization accuracy to $\delta' < \frac{\epsilon}{4+4\tau L}\delta$. This implies an optimization complexity of $O\left(\frac{1+\tau L}{1-\tau L}\log\left(\frac{4+4\tau L}{\epsilon\delta}\right)\right)$. + +\textbf{3. Rejection Sampling Efficiency.} +The expected number of iterations until acceptance is at most $\left(\frac{1+\tau L}{1-\tau L}\right)^{d/2}$\citep{chewi2022query}. Note that if we choose $\tau = \frac{1}{Ld}$, then the +expected number of iterations until acceptance is at most $\left(\frac{1+\tau L}{1-\tau L}\right)^{d/2} = \left(\frac{1+1/d}{1-1/d}\right)^{d/2} = O(1)$. +As $d \to \infty$, this expression converges to $e$. Thus, for this choice of $\tau$, the expected number of rejection sampling trials is $O(1)$. + +\textbf{4. Total Complexity.} +The total complexity is the product of the optimization complexity and the expected number of rejection sampling iterations. With $\tau = \frac{1}{Ld}$, the condition number becomes $\kappa = \frac{d+1}{d-1}$. +More precisely, the complexity is: +\[ +O\left(\left(\frac{d+1}{d-1}\right)^{\frac{d}{2} + 1} \times\log\left(\frac{4d+4}{d\epsilon\delta}\right) \right) = O(\log\left(\frac{1}{\epsilon\delta}\right)) +\] +This completes the proof. +\end{proof} + +\begin{remark}[Practical Limitations] +The theoretical complexity presented in Theorem \ref{thm:rgo_complexity} is highly compelling when compared to alternative sampling methodologies. However, its applicability is constrained by stringent underlying assumptions. +\begin{enumerate} + \item \textbf{Smoothness Requirement:} The analysis presupposes that the loss function $\ell$ is $L$-smooth. In many practical applications, loss functions are non-smooth or exhibit a very large smoothness constant $L$. + \item \textbf{Parameter Dependency:} The optimal setting for the parameter, $\tau = \frac{1}{Ld}$, is inversely proportional to both the smoothness constant $L$ and the dimension $d$. If $L$ is large, the resulting $\tau$ will be small. This makes the worst-case distribution very close to the original distribution, thereby limiting the robustness conferred by the method. +\end{enumerate} +Consequently, while the theoretical result is intriguing, the method's performance in empirical settings is often suboptimal due to the difficulty in satisfying these idealized conditions. +\end{remark} + + +\section{Additional Experiments} +\subsection{Ablation Study for Human Face Classification} +\label{sec:ablation} + +In this section, we evaluate the sensitivity of the proposed WFR gradient flow sampler to its key hyperparameters. To ensure a controlled comparison, we vary one parameter at a time while keeping the others fixed at their baseline values. The baseline configuration is defined as follows: regularization $\tau=5$, entropy regularization $\epsilon=0.1$, learning rate $\eta=0.01$, number of particles $m=32$, and total iterations $T=10,000$. All qualitative comparisons are conducted using a fixed representative sample from the FFHQ test set to ensure consistency. + +Figure \ref{fig:ablation_grid} presents the qualitative results of varying the regularization strength, learning rate, and the number of particles. As shown in Figure \ref{fig:ab_tau}, a small regularization value ($\tau=0.5$) overly constrains the latent code to the source distribution, causing the model to retain original features such as masculine traits. The baseline value of $\tau=5$ achieves a successful attribute transition while effectively preserving the identity of the source image. However, when $\tau$ is excessively large, the sampler fails to maintain the underlying facial structure, leading to unrealistic results. + +The learning rate $\eta$ and the number of particles $m$ also play critical roles in the sampling process. As observed in Figure \ref{fig:ab_lr}, a smaller learning rate can mitigate artifacts and distortions in the generated images, providing more stable updates. Regarding the number of particles, Figure \ref{fig:ab_samples} demonstrates that increasing $m$ consistently improves the quality and stability of the generated samples by providing a better approximation of the gradient flow. + +We further analyze the entropy regularization $\epsilon$, which governs the stochasticity and diversity of the generated images. As illustrated in the multi-sample comparison in Figure \ref{fig:ab_epsilon}, low entropy leads to nearly deterministic trajectories with minimal variation between samples. At the intermediate baseline of $\epsilon=0.1$, the sampler produces diverse yet realistic adversarial candidates. Conversely, increasing $\epsilon$ to $1.0$ introduces excessive noise that dominates the drift term, resulting in significant image degradation and loss of semantic content. + +\begin{figure}[h!] + \centering + \begin{minipage}[c]{0.42\textwidth} + \centering + \begin{subfigure}[b]{\textwidth} + \centering + \includegraphics[width=\textwidth]{exp_tau.pdf} + \caption{Effect of Regularization $\tau$} + \label{fig:ab_tau} + \end{subfigure} + \vspace{0.2cm} + \begin{subfigure}[b]{\textwidth} + \centering + \includegraphics[width=\textwidth]{exp_lr.pdf} + \caption{Effect of learning rate $\eta$} + \label{fig:ab_lr} + \end{subfigure} + \vspace{0.2cm} + \begin{subfigure}[b]{\textwidth} + \centering + \includegraphics[width=\textwidth]{exp_num_samples.pdf} + \caption{Effect of the number of particles $m$} + \label{fig:ab_samples} + \end{subfigure} + \end{minipage} + \hfill + \begin{minipage}[c]{0.54\textwidth} + \centering + \begin{subfigure}[b]{\textwidth} + \centering + \includegraphics[width=\textwidth]{exp_epsilon.pdf} + \caption{Effect of Entropy Regularization $\epsilon$ on Diversity} + \label{fig:ab_epsilon} + \end{subfigure} + \end{minipage} + \caption{Qualitative ablation study on the WFR sampler parameters. (a-c) show the sensitivity of single-sample generation to $\tau$, $\eta$, and $m$. (d) visualizes the Top-3 candidates for each $\epsilon$ to demonstrate sample diversity. The leftmost column in each figure represents the original source image.} + \label{fig:ablation_grid} +\end{figure} + +Finally, we visualize the temporal evolution of the latent code in Figure \ref{fig:convergence}. The progression from iteration 250 to 1,000 demonstrates a stable and smooth transition toward the target attribute, confirming the ability of generating samples from the worst-case distribution of the proposed method. + +\begin{figure}[h!] + \centering + \includegraphics[width=0.95\textwidth]{exp_convergence.pdf} + \caption{Visualization of the convergence process. The sampler demonstrates a gradual and stable transition towards the target attribute.} + \label{fig:convergence} +\end{figure} + + +\subsection{Multi-class Logistic Regression on CIFAR-10 Features}\label{sec:appx_features} +We assess adversarial robustness using multi-class logistic regression on 512-dimensional features extracted from the CIFAR-10 dataset \citep{krizhevsky2009learning} via a pre-trained ResNet-50. This convex setting is complementary to the deep non-convex experiments in Sections~\ref{sec:lenet_mnist} and~\ref{sec:cifar_resnet}: it allows us to compare the full set of methods (including RGO-DRO and SVG-DRO) head to head across a sweep of $\epsilon$ values. The model minimizes the multi-class logistic loss +\[ +\ell(B, x, y) = -y^\top B^\top x + \log\!\left(\mathbf{1}^\top \exp(B^\top x)\right), +\] +where $B \in \mathbb{R}^{512\times 10}$ is the parameter matrix and $y\in\mathbb{R}^{10}$ is the one-hot label. Perturbations affect only the features $x$; labels are fixed. The transport cost is defined as +\[ +c((x, y), (x', y')) = \|x - x'\|_2^2 + \infty \cdot \mathbf{1}_{y \neq y'}. +\] +To evaluate robustness, we apply a Projected Gradient Descent (PGD) attack \citep{madry2017towards} with $L_2$-norm constraints to the test data. The perturbation magnitude $\Delta$ is normalized by the average $L_2$-norm of the test features, and we vary $\Delta$ from $0$ to $0.08$. Performance is measured by the misclassification rate. + +\begin{figure*}[h!] +\centering +\begin{subfigure}{0.3\textwidth} + \includegraphics[width=\textwidth]{rgo_lam=10_eps=0.2.pdf} + \caption{$\tau=0.05, \epsilon=0.2$} +\end{subfigure} +\hfill +\begin{subfigure}{0.3\textwidth} + \includegraphics[width=\textwidth]{rgo_lam=10_eps=0.02.pdf} + \caption{$\tau=0.05, \epsilon=0.02$} +\end{subfigure} +\hfill +\begin{subfigure}{0.3\textwidth} + \includegraphics[width=\textwidth]{rgo_lam=10_eps=0.002.pdf} + \caption{$\tau=0.05, \epsilon=0.002$} +\end{subfigure} +\caption{CIFAR-10 feature classification error under $L_2$-norm PGD attack. The plots show test error (\%) versus normalized perturbation $\Delta$. Models are trained for 10 epochs; inner loops use a stepsize of 0.01 for 100 iterations.} +\label{fig:robustness} +\end{figure*} + +As shown in Figure~\ref{fig:robustness}, RGO-DRO fails to provide robustness, performing similarly to the SAA baseline. This suggests the inefficiency of rejection sampling on non-smooth loss functions, which is further supported by the results in Appendix~\ref{sec:experiment3}. The Dual method is sensitive to $\epsilon$ and becomes less robust as $\epsilon$ decreases. Notably, SVG-DRO performs nearly identically to WRM, showing a mode collapse issue (detailed in Appendix~\ref{sec:experiment3}). As observed in Figure~\ref{fig:svg_force}, with a small number of particles $m$, the repulsive force fails to prevent convergence to a single adversarial point. In contrast, the SDE-based methods (WFR-DRO and WGF-DRO) avoid this issue and achieve high robustness across all settings. + + +\subsection{Additional Diagnostics for CNN Experiments}\label{sec:appx_diagnostics} +This section provides training details of the experiments in Section~\ref{sec:cifar_resnet}, including convergence curves and wall-clock +cost, and a sensitivity analysis with respect to $\tau$ based on the experiments in Section~\ref{sec:cifar_resnet}. +\paragraph{Experimental setup.} +To accommodate the $32\!\times\!32$ input resolution, we apply the standard CIFAR-10 adaptation of ResNet-18: the first convolution is replaced with a $3\!\times\!3$, stride-$1$ kernel, the initial max-pooling layer is removed, and the final fully connected layer is replaced with a $10$-way classifier. +All methods share this architecture and pretraining. Training uses SGD with learning rate $0.01$, momentum $0.9$, and weight decay $5\!\times\!10^{-4}$, batch size $256$, for $20$ epochs. + +\paragraph{Convergence diagnostics} Figure~\ref{fig:loss_curves} shows the outer-loop training loss. WRM +behaves almost identically to SAA. WGF-DRO, WFR-DRO and Dual exhibit +a similar overall trend, but WGF-DRO and WFR-DRO decay faster than +Dual, as the Dual gradient estimator suffers exponential bias in +$B\tau/\epsilon$ (where $B := \sup\ell(\theta,x)$, see +\citet{wang2021sinkhorn}) when the loss is large. WFR-DRO is +consistently a bit faster than WGF-DRO, which is consistent with +our theory. + +\begin{figure}[h] +\centering +\includegraphics[width=0.5\linewidth]{loss_curves.pdf} +\caption{Training loss convergence on CIFAR-10 ResNet-18 (mean $\pm$ std over 5 runs).} +\label{fig:loss_curves} +\end{figure} + +\paragraph{Computational cost and \texorpdfstring{$\tau$}{tau}-sensitivity.} +Table~\ref{tab:wallclock} reports wall-clock time per epoch; Table~\ref{tab:tau_sweep} reports a $\tau$-sweep on MNIST LeNet-5 under PGD-$L_\infty$ at $\Delta=0.10$. The overhead relative to WRM scales with $m$; the $m$ particle updates are independent and fully parallelizable on GPU, so the wall-clock overhead is sub-linear in $m=8$ in practice. The Dual method is cheapest per epoch among all DRO methods. The $\tau$-sweep confirms WFR-DRO's advantage holds across the full hyperparameter range: WFR-DRO at its worst-case $\tau=0.05$ ($10.92\%$) still beats WRM at its best $\tau=1.0$ ($12.94\%$). + +\begin{table*}[h!] +\centering +\begin{minipage}[t]{0.48\textwidth} +\centering +\caption{Wall-clock time per epoch (seconds).} +\label{tab:wallclock} +\resizebox{\linewidth}{!}{% +\begin{tabular}{lcc} +\toprule +Method & MNIST LeNet-5 & CIFAR-10 ResNet-18 \\ +\midrule +SAA & $20.43 \pm 0.56$ & $19.01 \pm 0.22$ \\ +Dual & $21.99 \pm 0.89$ & $84.66 \pm 5.63$ \\ +WRM & $24.64 \pm 0.69$ & $195.11 \pm 0.65$ \\ +WGF-DRO & $32.66 \pm 0.51$ & $711.29 \pm 7.53$\\ +WFR-DRO & $52.57 \pm 1.42$ & $1022.15 \pm 11.69$ \\ +\bottomrule +\end{tabular}% +} +\end{minipage}\hfill +\begin{minipage}[t]{0.48\textwidth} +\centering +\caption{$\tau$-sweep error (\%) on MNIST LeNet-5 under PGD-$L_\infty$ at $\Delta=0.10$.} +\label{tab:tau_sweep} +\resizebox{\linewidth}{!}{% +\begin{tabular}{ccccc} +\toprule +$\tau$ & WFR-DRO & WGF-DRO & WRM & Dual \\ +\midrule +$0.05$ & $10.92$ & $12.05$ & $13.51$ & $11.09$ \\ +$0.5$ & $\phantom{0}8.58$ & $\phantom{0}9.40$ & $13.34$ & $11.14$ \\ +$1.0$ & $\phantom{0}8.78$ & $\phantom{0}8.83$ & $12.94$ & $11.36$ \\ +\bottomrule +\end{tabular}% +} +\end{minipage} +\end{table*} + + +\subsection{Two Moon Classification}\label{sec:experiment3} +In this section, we compare methods on an imbalanced binary classification problem using the 'two moons' dataset. The model is a three-layer neural network with ReLU activations and a hidden dimension of 16. The objective is to minimize the cross-entropy loss. The cost function for samples $(x, y)$ and $(x', y')$ is defined as $c((x,y),(x',y'))=\|x-x'\|_2^2 + \infty \cdot \mathbf{1}_{y\neq y'}$. + +The training data is generated by \texttt{sklearn.make\_moons} with a noise level of 0.1. To introduce class imbalance, the training set of $N_{\text{train}}=200$ samples consists of 90\% positive ($y=1$) and 10\% negative ($y=0$) samples. + +\begin{figure}[h!] + \centering + \includegraphics[scale=0.7]{boundary_5_0.01.pdf} + \caption{Decision boundary comparison for all methods on the two-moon classification task. For all DRO methods, we set $\tau=0.1$, and for SDRO methods, we set $\epsilon=0.01$. In each inner loop, WFR and WGF generate $m=5$ particles.} + \label{fig:final_boundaries} +\end{figure} + + +Figure~\ref{fig:final_boundaries} illustrates the decision boundaries learned by various algorithms against the ideal boundary. Notably, the boundary from the WRM method fails to correctly separate the training data. The Dual method, while separating the classes in high-density regions, learns a boundary that deviates significantly from the ground truth. In contrast, WFR, and WGF learn boundaries that more closely approximate the ideal curve. Among them, WFR and WGF achieve the best results, tracking the ideal separator with high fidelity, which indicates superior performance in this setting. + + +To evaluate the capacity of generating the worst-case distribution of WRM, WGF, WFR, SVG, and RGO, we conducted an experiment on a pre-trained SAA model. This setup isolates the inner-loop optimization process used to find the worst-case distribution. The evolution of the inner objective function, $\mathbb{E}[-\widetilde V_{x, \tau}(z)]$, is depicted in Figure~\ref{fig:loss_twomoon}. + + +The efficacy of WGF, WFR, and SVG in approximating the worst-case distribution is demonstrated by a significant increase in the objective value. The reweighting mechanism in WFR contributes to its faster convergence compared to WGF. In contrast, SVG's performance is highly dependent on its initialization parameters. An initial standard deviation of 0.1 leads to slower convergence than a standard deviation of 0.2, which achieves a rate similar to WFR. This sensitivity is attributed to the ability of a larger initial standard deviation to propel particles across the decision boundary, thereby facilitating a more thorough exploration of the perturbation space, as illustrated later in Figure~\ref{fig:perturbation_samples}. In contrast, WGF and WFR initiate their optimization from the empirical data distribution, which obviates the need to select initialization parameters. +\begin{figure}[h!] +\centering + \includegraphics[scale=0.6]{saa_perturb_objective_comparison.pdf} + \caption{Evolution of $\mathbb{E}[\widetilde V_{x, \tau}(z)]$. We run all methods for 300 steps with a stepsize of 0.01. For RGO (blue), we run a rejection sampling procedure after solving the inner optimization problem. SVG\_0.1 and SVG\_0.2 denote initial distributions with a standard deviation of 0.1 and 0.2, respectively.} + \label{fig:loss_twomoon} +\end{figure} + +\begin{figure*}[h!] +\centering + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{wrm_frame.pdf} + \caption{Perturbation by WRM} + \label{fig:wrm_perturb} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{rgo_frame.pdf} + \caption{Perturbation by RGO} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{wgf_frame.pdf} + \caption{Perturbation by WGF} + \label{fig:wgf_perturb} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{wfr_frame.pdf} + \caption{Perturbation by WFR} + \label{fig:wfr_perturb} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{svg_frame_0.1.pdf} + \caption{Perturbation by SVG ($\sigma=0.1$)} + \label{fig:svg0.1} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{svg_frame_0.2.pdf} + \caption{Perturbation by SVG ($\sigma=0.2$)} + \label{fig:svg0.2} + \end{subfigure} + \caption{Visualization of perturbed samples (gray-edged smaller circles) generated from original data (black-edged bigger circles) against the SAA boundary at the final step. For all methods, we use a stepsize of 0.01 and run for 300 iterations. For WFR, the intensity of points visualizes the sample weights. We show perturbations by SVG-DRO with different initializations.} + \label{fig:perturbation_samples} +\end{figure*} + +Conversely, WRM and RGO fail to significantly increase the objective. The non-convex nature of the objective, evidenced by the initial dip and subsequent rise for WGF and WFR, likely presents a challenge for the optimization procedures in WRM and RGO. Additionally, the performance of RGO is hindered by its rejection sampling stage, which is inefficient for non-smooth objectives. + + + +Figure~\ref{fig:perturbation_samples} provides a visual confirmation of these results, displaying the perturbed samples at the final iteration of the inner loop. WRM generates minimal perturbations, with particles remaining in close proximity to the original data points. The perturbations from RGO are qualitatively similar, appearing as slightly noisier versions of the WRM results. In contrast, WGF, WFR, and SVG generate a diverse set of adversarial examples, effectively pushing samples across the decision boundary, including those initially distant from it. Notably, the extent of perturbation for SVG is dependent on the initialization; an initial standard deviation of 0.2 results in more significant perturbations than a standard deviation of 0.1. And the particles generated by SVG for a single data point tend to be highly concentrated. + +This phenomenon arises from the interplay between the two forces governing SVGD: a driving force that pushes particles toward regions of higher loss and a repulsive force from the kernel that prevents particle collapse. The optimization dynamics, visualized in Figure~\ref{fig:svg_force}, show that the driving force initially dominates, causing the particles to converge. As the particles draw closer, the repulsive force increases to counteract this convergence. However, since the number of particles is relatively small, the repulsive force only dominates when particles are very close, leading to the observed particle concentration. This result also explains the reason why SVG shows nearly identical performance as WRM in Appendix~\ref{sec:appx_features}. + +\begin{figure*}[h!] +\centering + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{frame_020.pdf} + \caption{Iteration 20} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{frame_100.pdf} + \caption{Iteration 100} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{frame_288.pdf} + \caption{Iteration 300} + \end{subfigure} + \caption{Evolution of particle positions in the SVG method. The driving force guides initial convergence, while the repulsive force prevents complete collapse. But in this experiment, the repulsive force fails to push particles apart efficiently, leading to the mode collapse. } + \label{fig:svg_force} +\end{figure*} + + + + + + + + +\subsection{Classification under Data Imbalance}\label{sec:circle-exp} + +\begin{figure*}[h!] +\begin{subfigure}[b]{0.32\textwidth} + \includegraphics[width=\textwidth]{circle_boundary_comparison.pdf} + \caption{Decision boundaries} + \label{fig:circle-boundary} + \end{subfigure} + \hfill + \begin{subfigure}[b]{0.32\textwidth} + \includegraphics[width=\textwidth]{WFR_frame_000_samples.pdf} + \caption{Perturbation by WFR} + \label{fig:WFR_circle} + \end{subfigure} + \hfill + \begin{subfigure}[b]{0.32\textwidth} + \includegraphics[width=\textwidth]{WRM_frame_000_samples.pdf} + \caption{Perturbation by WRM} + \label{fig:WRM_circle} + \end{subfigure} + \caption{\textbf{Robust Decision Boundaries with Biased Data.} \textbf{(a)} Decision boundaries learned by different methods on the biased circle dataset. The training data are shown as orange (positive class) and blue (negative class) points. The final classification boundaries are shown for the WRM (green), WGF (purple), WFR (red), and Dual (brown) models. All models were trained for 40 epochs. We set the regularization parameter $\tau=2.5$ for all methods and the entropy regularization $\epsilon=0.15$ for methods based on entropy-regularized Wasserstein DRO problem. \textbf{(b)} Samples from the worst-case distribution generated by WFR sampler at the first epoch. + \textbf{(c)} Worst-case samples generated by WRM method at the first epoch. WRM can only generate discrete distributions as worst-case distribution while entropy-regularized DRO uses potentially continuous distributions as worst-case distribution. The original data points are shown as circles with black edge and the worst-case samples are shown by circles with a shallower color.} + \label{fig:circle-experiment} +\end{figure*} +This experiment demonstrates the robustness of our proposed methods to data imbalance. The experimental setup is adapted from \citep{sinha2020certifyingdistributionalrobustnessprincipled}. We generate a dataset where features $X \in \mathbb{R}^2$ are drawn from a Gaussian distribution. The labels are assigned based on the rule $Y = \text{sign}(\|X\|_2 - \sqrt{2})$, which creates two classes separated by a circle of radius $\sqrt{2}$. To establish a clear margin, all data points satisfying $\|X\|_2 \in (\sqrt{2}/1.3, 1.3\sqrt{2})$ are excluded. To simulate a biased training distribution, we remove all samples from the first quadrant. This removal introduces a significant imbalance, testing the ability of each algorithm to learn a generalizable decision boundary rather than overfitting to the biased training data. The model is a neural network with a single hidden layer of 4 units. + + + +Figure~\ref{fig:circle-boundary} visualizes the learned decision boundaries. WFR learns a decision boundary that closely matches the true circular boundary, correctly classifying the held-out data in the first quadrant and thus demonstrating robustness to the distributional shift. In contrast, the WRM boundary is overly expansive, misclassifying large regions of the feature space. This indicates a failure to generalize from the biased training set, resulting in a less reliable classifier. The boundary from WGF lies between those of WFR and WRM, highlighting the benefit of the weight flow mechanism in WFR for achieving a more robust solution. The dual method \citep{wang2021sinkhorn} does not perform as well as WFR in this setting. We attribute this to the high sensitivity of the dual method to the choice of hyperparameters ($\epsilon$ and $\lambda$), which can significantly impact the bias of the gradient estimator. + + +To further investigate the differing behaviors, Figure~\ref{fig:WFR_circle} and Figure~\ref{fig:WRM_circle} visualize the samples generated by WFR and WRM at the first epoch. We observe that the samples generated by WFR algorithm begin to recover parts of the missing data distribution in the first quadrant. Conversely, the samples generated by WRM fail to do so, providing insights into why it learns a less robust boundary. + + +We also conducted an experiment with an increased training set of 2000 samples while keeping all other settings unchanged. With a larger dataset, the decision boundaries of all methods are expected to converge toward the true circular boundary. In this high-data regime, WGF, Dual, and WRM learn similar boundaries that are nearly circular but still exhibit noticeable deviations. WFR, however, learns a tight and circular boundary, demonstrating its consistent superior performance (see Figure~\ref{fig:circle_2000}). +\begin{figure}[h] + \centering + \includegraphics[width=0.45\linewidth]{2000.pdf} + \caption{Decision boundaries on the Biased Circle dataset with 2000 training samples. WFR still learns a more accurate circular boundary compared to other methods.} + \label{fig:circle_2000} +\end{figure} + + + + + + + + + + + + + +\subsection{Uncertain Least Square} +We evaluate our methods on a distributionally robust least squares problem, following the setup from \citep{zhu2021kernel}, which was adapted from \citep{el1997robust}. The objective is to find a parameter vector $\theta \in \mathbb{R}^{10}$ that minimizes the loss $f_{\theta}(\xi) = \|A(\xi)\theta - b\|_2^2$, where the system matrix $A(\xi)$ is subject to uncertainty. The matrix $A(\xi) = A_0 + \xi A_1 \in \mathbb{R}^{10 \times 10}$ is an affine function of an uncertain scalar parameter $\xi \in [-1, 1]$. The matrices $A_0, A_1$ and the vector $b$ are fixed, with entries drawn independently from a standard normal distribution $\mathcal{N}(0, 1)$. + +\begin{figure}[h!] + \centering + \includegraphics[scale=0.6]{uncertain_least_squares_results.pdf} + \caption{Test loss as a function of the perturbation level $\Delta$ for the uncertain least squares problem. All methods were trained for 10 epochs with $\lambda=0.1$. For methods with an inner loop, the stepsize was $0.0001$ for $3000$ iterations. SDRO-based methods used $\epsilon=0.1$. WGF and WFR used $m=8$ particles.} + \label{fig:uls_results} +\end{figure} +The training set comprises $N=10$ samples $\{\xi_i\}_{i=1}^{N}$ drawn uniformly from $[-0.5, 0.5]$. To evaluate robustness, test samples are drawn from a shifted distribution, specifically uniform on $[-0.5(1+\Delta), 0.5(1+\Delta)]$. We vary the shift magnitude $\Delta$ from $0$ to $10$, where a larger $\Delta$ signifies a greater departure from the training distribution. + + + +Figure~\ref{fig:uls_results} shows the test loss as a function of the perturbation level $\Delta$. All distributionally robust methods maintain a significantly lower test loss than the empirical risk minimization baseline, demonstrating their robustness to distributional shifts. At low perturbation levels, all robust methods perform comparably. As $\Delta$ increases, the performance of the dual method degrades more rapidly than the others. WFR shows a marginal improvement over WGF and WRM. This limited advantage is attributable to the one-dimensional, bounded nature of the inner problem, which constrains worst-case samples to lie near the boundary of $[-1, 1]$, thus minimizing the differences between the generated adversarial distributions. + + + +\paragraph*{Acknowledgement.} +We thank Jie Wang~\citep{wang2025iterative} for pointing out a flaw in our original proof of Theorem~\ref{thm:ula}, which we have now fixed. + + +\bibliographystyle{apalike} +\bibliography{Bibliography} + + + + + +\end{document} diff --git a/source_current/original.pdf b/source_current/original.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ff65586d18af5a0d0afb5bc5562bd83c54e76019 --- /dev/null +++ b/source_current/original.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd6d8ab7f5449d3a6f5f769209970b0b2f1e7e004bd5491a6287c27d271f5287 +size 339848 diff --git a/source_current/perturbed_top3.pdf b/source_current/perturbed_top3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8b141ae087fb44c7efd112ec75dc2b93dba0c434 --- /dev/null +++ b/source_current/perturbed_top3.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae46893be793deb8ad162e067ea16c3c4fc435396e1d6d49b1295fc741429de0 +size 1392650 diff --git a/source_current/preamble-JZ.sty b/source_current/preamble-JZ.sty new file mode 100644 index 0000000000000000000000000000000000000000..d695d08a63889c69a60e7c40a845cbe9db6111fc --- /dev/null +++ b/source_current/preamble-JZ.sty @@ -0,0 +1,299 @@ +% from JZ's style + +% ---------------------------------- +% JZ's hide-show routine +% I moved it to the main tex file so vscode can autocomplete it +% ---------------------------------- +% for generally hiding some texts with a toggle on or off: +\usepackage{comment} + +% Define the CUT environment +\newenvironment{CUT}{}{} + +% Command to toggle the CUT environment +\newcommand{\toggleCUT}[1]{% + \if#1t% + \renewenvironment{CUT}{\color{gray}}{\color{black}}% + \else% + \excludecomment{CUT}% + \fi% +} + + +% Set the initial state (t to show, f to hide) +\toggleCUT{t} +\toggleCUT{f} + +% Required package for colors +\RequirePackage{xcolor} + + % Place this in the preamble of your document + + +% Required packages for mathbb and other math symbols +% \RequirePackage{amssymb} +% \RequirePackage{amsmath} +% \RequirePackage{amsthm} + +% % Theorem environments +% \theoremstyle{definition} +% \newtheorem{theorem}{Theorem} +% \newtheorem{lemma}{Lemma} +%\newtheorem{proposition}{Proposition} +% \newtheorem{corollary}{Corollary} +% \newtheorem{remark}{Remark} +\newtheorem{example}{Example} + +\usepackage{enumitem} % for tighter itemize +\newenvironment{tightenum}{ + \begin{enumerate}[itemsep=0pt, parsep=0pt, topsep=0pt, partopsep=0pt] +}{ + \end{enumerate} +} + +\newenvironment{tightitem}{ + \begin{itemize}[itemsep=0pt, parsep=0pt, topsep=0pt, partopsep=0pt] +}{ + \end{itemize} +} + +% \newcommand{\jz}[1]{\text{\color{red}\textbf{JZ: }#1}} + +%%shorthand%% +\newcommand{\dFdmu}{\frac{\delta F}{\delta \mu}\left[\mu\right]} +\newcommand{\dFdrho}{\frac{\delta F}{\delta \rho}\left[\rho\right]} +\newcommand{\dFdmuk}{\frac{\delta F}{\delta \mu}\left[\mu^k\right]} % first var evaluted at k step; explicit +\newcommand{\epsjko}{\operatorname{\epsilon-\text{JKO}}} +\DeclareMathOperator*{\argmin}{argmin} +\DeclareMathOperator*{\argmax}{argmax} +\DeclareMathOperator*{\arginf}{arginf} +\DeclareMathOperator*{\argsup}{argsup} +% \DeclareMathOperator{\mmd}{MMD} +\newcommand{\dd}{\ \mathrm{d}} +% \newcommand{\rkhs}{\mathcal{H}} +\newcommand{\hiprod}[2]{\langle {#1, #2} \rangle _{\mathcal H}} %%RKHS inner product%% +\newcommand{\iprod}[2]{\langle {#1, #2} \rangle } +% \newcommand{\K}{\mathcal{K}} %%often used as integral operator%% +\newcommand{\E}{\mathbb{E}} %%exp operator%% +\newcommand{\R}{\mathbb{R}} +\newcommand{\DIV}{\mathrm{div}\,} +\newcommand{\const}{\mathrm{const.}} +\newcommand{\eviL}{(EVI)$_\lambda$} + +%%transport problem shorthand%% +% \newcommand{\ET}{\mathsf{E\kern-1pt T}} +% \newcommand{\MET}{\mathsf{M\kern-1pt E\kern-1pt T}} +% \newcommand{\IPT}{\mathsf{I\kern-1pt P\kern-1pt T}} +% \newcommand{\MIPT}{\mathsf{M\kern-1pt I\kern-1pt P\kern-1pt T}} +% \newcommand{\EIPT}{\mathsf{E\kern-1pt I\kern-1pt P\kern-1pt T}} +% \newcommand{\WFR}{\mathsf{W\kern-1pt F\kern-1pt R}} + +%%missing commands in markdown%% +\newcommand{\bm}[1]{\boldsymbol{\mathbf{#1}}} + +%%shorthand dissipation potential%% +% \newcommand{\Rk}{\mathcal R_k} %%dissipation of MMD potentail%% +\newcommand{\Kotto}{\mathbb{K}_\text{Otto}} %%Otto operator for diffusion%% +\newcommand{\Mplus}{\mathcal{M}^+} %%nonneg measure%% + +%%wgf jargon%% +\newcommand{\mslope}{|\nabla^- F|} % metric slope +\newcommand{\mder}{|\mu'|} % metric derivative + +%%sum notation%% +\newcommand{\sumiN}{\frac{1}{N}\sum_{i=1}^N} +\newcommand{\sumijMN}{\frac{1}{MN}\sum_{i=1}^M\sum_{j=1}^N} +\newcommand{\sumijNN}{\frac{1}{MN}\sum_{i=1}^N\sum_{j=1}^N} +\newcommand{\sumijMM}{\frac{1}{MM}\sum_{i=1}^M\sum_{j=1}^M} +% \newcommand{\sumijMNUnbiased}{\frac{1}{MN}\sum_{i=1}^M\sum_{j=1, j\neq i}^N} +\newcommand{\sumijNNUnbiased}{\frac{1}{N(N-1)}\sum_{i=1}^N\sum_{j=1, j\neq i}^N} +\newcommand{\sumijMMUnbiased}{\frac{1}{M(M-1)}\sum_{i=1}^M\sum_{j=1, j\neq i}^M} + +%%semi transparent%% +\newcommand{\semitransp}[2][35]{\textcolor{fg!#1}{#2}} + +%%colored text%% +\newcommand{\redA}{{\color{red}\alpha}} +\newcommand{\blueB}{{\color{blue}\beta}} + +\newcommand{\DF}{\mathrm{D} F} % differential of F + + +%% KL divergence and NGD %% +\newcommand{\mul}{\mu_\lambda} +\newcommand{\mulk}{\mu_{\lambda^k}} +\newcommand{\KL}{\operatorname{KL}} + + +%% acronym for distances %% +\newcommand{\ET}{\mathsf{E\kern-1pt T}} +\newcommand{\MET}{\mathsf{M\kern-1pt E\kern-1pt T}} +\newcommand{\IPT}{\mathsf{I\kern-1pt P\kern-1pt T}} +\newcommand{\IMT}{\mathsf{I\kern-1pt M\kern-1pt T}} +\newcommand{\MIPT}{\mathsf{M\kern-1pt I\kern-1pt P\kern-1pt T}} +\newcommand{\EIPT}{\mathsf{E\kern-1pt I\kern-1pt P\kern-1pt T}} +\newcommand{\WFR}{\mathsf{W\kern-1pt F\kern-1pt R}} +\newcommand{\FR}{\mathsf{F\kern-1pt R}} +\newcommand{\He}{\mathsf{He}} +% \newcommand{\KFR}{\mathsf{K\kern-1pt{-}\kern-1pt F\kern-1pt R}} +\newcommand{\FRk}{\mathsf{F\kern-1pt R}_k} +\newcommand{\supp}[1]{\operatorname{supp}(#1)} + +\DeclareMathOperator{\mmd}{MMD} +\DeclareMathOperator{\MMD}{MMD} +\DeclareMathOperator{\ksd}{KSD} +\DeclareMathOperator{\KSD}{KSD} + +\newcommand{\wtwostein}{\ensuremath{W_2}-Stein\xspace} + +\newcommand{\Lstein}{\ensuremath{\lambda}\text{-Stein}\xspace} + +% \newcommand{\wtwosteinLm}{\ensuremath{W_2^\lambda}-Stein\xspace} + +% \newcommand{\fstein}{F-Stein\xspace} + +\DeclareMathOperator{\ipm}{IPM} + +\DeclareMathOperator{\imm}{IMM} + +\newcommand{\rkhs}{\mathcal{H}} + +\newcommand{\K}{\mathcal{K}} %%often used as integral operator%% + +\newcommand{\Tk}{\mathcal{T}_k} %%often used as (L2->H) integral operator%% + +\newcommand{\Tkrho}{\mathcal{T}_{k,\rho}} %%often used as (L2->H) integral operator%% + +\newcommand{\Tkmu}{\mathcal{T}_{k,\mu}} %%often used as (L2->H) integral operator%% + +% \newcommand{\DF}{\mathrm{D} F} % differential of F + +% \newcommand{\Mplus}{\mathcal{M}^+} %%nonneg measure%% + +% \newcommand{\Rk}{\mathcal R_k} %%dissipation of MMD potentail%% + +% \newcommand{\RfrMMD}{\mathcal R_\mathrm{FR-MMD}} %%dissipation of MMD potentail%% regularized + +% \newcommand{\Kotto}{\mathbb{K}_\mathrm{Otto}} %%Otto operator for diffusion%% + +\newcommand{\ID}{\operatorname{Id}} %%Identify operator + +\newcommand{\Loj}{\L{}ojasiewicz\xspace} + + +%% short hand %% + +\newcommand{\Pth}{{P_\theta}} % parameterized distribution + +%% Alex's notation %% + +% Blackboardbold +\def\bbA{{\mathbb A}} \def\bbB{{\mathbb B}} \def\bbC{{\mathbb C}} +\def\bbD{{\mathbb D}} \def\bbE{{\mathbb E}} \def\bbF{{\mathbb F}} +\def\bbG{{\mathbb G}} \def\bbH{{\mathbb H}} \def\bbI{{\mathbb I}} +\def\bbJ{{\mathbb J}} \def\bbK{{\mathbb K}} \def\bbL{{\mathbb L}} +\def\bbM{{\mathbb M}} \def\bbN{{\mathbb N}} \def\bbO{{\mathbb O}} +\def\bbP{{\mathbb P}} \def\bbQ{{\mathbb Q}} \def\bbR{{\mathbb R}} +\def\bbS{{\mathbb S}} \def\bbT{{\mathbb T}} \def\bbU{{\mathbb U}} +\def\bbV{{\mathbb V}} \def\bbW{{\mathbb W}} \def\bbX{{\mathbb X}} +\def\bbY{{\mathbb Y}} \def\bbZ{{\mathbb Z}} +% Kalligraphische +\def\calA{{\mathcal A}} \def\calB{{\mathcal B}} \def\calC{{\mathcal C}} +\def\calD{{\mathcal D}} \def\calE{{\mathcal E}} \def\calF{{\mathcal F}} +\def\calG{{\mathcal G}} \def\calH{{\mathcal H}} \def\calI{{\mathcal I}} +\def\calJ{{\mathcal J}} \def\calK{{\mathcal K}} \def\calL{{\mathcal L}} +\def\calM{{\mathcal M}} \def\calN{{\mathcal N}} \def\calO{{\mathcal O}} +\def\calP{{\mathcal P}} \def\calQ{{\mathcal Q}} \def\calR{{\mathcal R}} +\def\calS{{\mathcal S}} \def\calT{{\mathcal T}} \def\calU{{\mathcal U}} +\def\calV{{\mathcal V}} \def\calW{{\mathcal W}} \def\calX{{\mathcal X}} +\def\calY{{\mathcal Y}} \def\calZ{{\mathcal Z}} + +%% alex notation for e, etc. %% +\def\d{\mathrm d} + +\def\dd{\;\!\mathrm{d}} % differential for integration + +\def\ee{\mathrm{e}} % Euler's number + +\def\ii{\mathrm{i}} % imaginary unit + + +%% alex special fonts %% +% Blackboardbold +\def\bbA{{\mathbb A}} \def\bbB{{\mathbb B}} \def\bbC{{\mathbb C}} +\def\bbD{{\mathbb D}} \def\bbE{{\mathbb E}} \def\bbF{{\mathbb F}} +\def\bbG{{\mathbb G}} \def\bbH{{\mathbb H}} \def\bbI{{\mathbb I}} +\def\bbJ{{\mathbb J}} \def\bbK{{\mathbb K}} \def\bbL{{\mathbb L}} +\def\bbM{{\mathbb M}} \def\bbN{{\mathbb N}} \def\bbO{{\mathbb O}} +\def\bbP{{\mathbb P}} \def\bbQ{{\mathbb Q}} \def\bbR{{\mathbb R}} +\def\bbS{{\mathbb S}} \def\bbT{{\mathbb T}} \def\bbU{{\mathbb U}} +\def\bbV{{\mathbb V}} \def\bbW{{\mathbb W}} \def\bbX{{\mathbb X}} +\def\bbY{{\mathbb Y}} \def\bbZ{{\mathbb Z}} +% Kalligraphische +\def\calA{{\mathcal A}} \def\calB{{\mathcal B}} \def\calC{{\mathcal C}} +\def\calD{{\mathcal D}} \def\calE{{\mathcal E}} \def\calF{{\mathcal F}} +\def\calG{{\mathcal G}} \def\calH{{\mathcal H}} \def\calI{{\mathcal I}} +\def\calJ{{\mathcal J}} \def\calK{{\mathcal K}} \def\calL{{\mathcal L}} +\def\calM{{\mathcal M}} \def\calN{{\mathcal N}} \def\calO{{\mathcal O}} +\def\calP{{\mathcal P}} \def\calQ{{\mathcal Q}} \def\calR{{\mathcal R}} +\def\calS{{\mathcal S}} \def\calT{{\mathcal T}} \def\calU{{\mathcal U}} +\def\calV{{\mathcal V}} \def\calW{{\mathcal W}} \def\calX{{\mathcal X}} +\def\calY{{\mathcal Y}} \def\calZ{{\mathcal Z}} +% mathromam +\def\rma{{\mathrm a}} \def\rmb{{\mathrm b}} \def\rmc{{\mathrm c}} +\def\rmd{{\mathrm d}} \def\rme{{\mathrm e}} \def\rmf{{\mathrm f}} +\def\rmg{{\mathrm g}} \def\rmh{{\mathrm h}} \def\rmi{{\mathrm i}} +\def\rmj{{\mathrm j}} \def\rmk{{\mathrm k}} \def\rml{{\mathrm l}} +\def\rmm{{\mathrm m}} \def\rmn{{\mathrm n}} \def\rmo{{\mathrm o}} +\def\rmp{{\mathrm p}} \def\rmq{{\mathrm q}} \def\rmr{{\mathrm r}} +\def\rms{{\mathrm s}} \def\rmt{{\mathrm t}} \def\rmu{{\mathrm u}} +\def\rmv{{\mathrm v}} \def\rmw{{\mathrm w}} \def\rmx{{\mathrm x}} +\def\rmy{{\mathrm y}} \def\rmz{{\mathrm z}} +\def\rmA{{\mathrm A}} \def\rmB{{\mathrm B}} \def\rmC{{\mathrm C}} +\def\rmD{{\mathrm D}} \def\rmE{{\mathrm E}} \def\rmF{{\mathrm F}} +\def\rmG{{\mathrm G}} \def\rmH{{\mathrm H}} \def\rmI{{\mathrm I}} +\def\rmJ{{\mathrm J}} \def\rmK{{\mathrm K}} \def\rmL{{\mathrm L}} +\def\rmM{{\mathrm M}} \def\rmN{{\mathrm N}} \def\rmO{{\mathrm O}} +\def\rmP{{\mathrm P}} \def\rmQ{{\mathrm Q}} \def\rmR{{\mathrm R}} +\def\rmS{{\mathrm S}} \def\rmT{{\mathrm T}} \def\rmU{{\mathrm U}} +\def\rmV{{\mathrm V}} \def\rmW{{\mathrm W}} \def\rmX{{\mathrm X}} +\def\rmY{{\mathrm Y}} \def\rmZ{{\mathrm Z}} +% fette math +\def\FG{\mathbf} +\def\mdot{\FG{:}} \def\vdot{\FG{\cdot}} +\def\bfa{{\FG a}} \def\bfb{{\FG b}} \def\bfc{{\FG c}} +\def\bfd{{\FG d}} \def\bfe{{\FG e}} \def\bff{{\FG f}} +\def\bfg{{\FG g}} \def\bfh{{\FG h}} \def\bfi{{\FG i}} +\def\bfj{{\FG j}} \def\bfk{{\FG k}} \def\bfl{{\FG l}} +\def\bfm{{\FG m}} \def\bfn{{\FG n}} \def\bfo{{\FG o}} +\def\bfp{{\FG p}} \def\bfq{{\FG q}} \def\bfr{{\FG r}} +\def\bfs{{\FG s}} \def\bft{{\FG t}} \def\bfu{{\FG u}} +\def\bfv{{\FG v}} \def\bfw{{\FG w}} \def\bfx{{\FG x}} +\def\bfy{{\FG y}} \def\bfz{{\FG z}} +\def\bfA{{\FG A}} \def\bfB{{\FG B}} \def\bfC{{\FG C}} +\def\bfD{{\FG D}} \def\bfE{{\FG E}} \def\bfF{{\FG F}} +\def\bfG{{\FG G}} \def\bfH{{\FG H}} \def\bfI{{\FG I}} +\def\bfJ{{\FG J}} \def\bfK{{\FG K}} \def\bfL{{\FG L}} +\def\bfM{{\FG M}} \def\bfN{{\FG N}} \def\bfO{{\FG O}} +\def\bfP{{\FG P}} \def\bfQ{{\FG Q}} \def\bfR{{\FG R}} +\def\bfS{{\FG S}} \def\bfT{{\FG T}} \def\bfU{{\FG U}} +\def\bfV{{\FG V}} \def\bfW{{\FG W}} \def\bfX{{\FG X}} +\def\bfY{{\FG Y}} \def\bfZ{{\FG Z}} +\def\BS{\boldsymbol} % griechisch +\def\bfalpha{{\BS\alpha}} \def\bfbeta{{\BS\beta}} +\def\bfgamma{{\BS\gamma}} \def\bfdelta{{\BS\delta}} +\def\bfepsilon{{\BS\varepsilon}} \def\bfzeta{{\BS\zeta}} +\def\bfeta{{\BS\eta}} \def\bftheta{{\BS\theta}} +\def\bfiota{{\BS\iota}} \def\bfkappa{{\BS\kappa}} +\def\bflambda{{\BS\lambda}} \def\bfmu{{\BS\mu}} +\def\bfnu{{\BS\nu}} \def\bfxi{{\BS\xi}} +\def\bfpi{{\BS\pi}} \def\bfrho{{\BS\rho}} +\def\bfsigma{{\BS\sigma}} \def\bftau{{\BS\tau}} +\def\bfphi{{\BS\phi}} \def\bfchi{{\BS\chi}} +\def\bfpsi{{\BS\psi}} \def\bfomega{{\BS\omega}} +\def\bfvarphi{{\BS\varphi}} +\def\bfGamma{{\BS\Gamma}} \def\bfDelta{{\BS\Delta}} +\def\bfTheta{{\BS\Theta}} \def\bfLambda{{\BS\Lambda}} +\def\bfXi{{\BS\Xi}} \def\bfPi{{\BS\Pi}} +\def\bfSigma{{\BS\Sigma}} \def\bfPhi{{\BS\Phi}} +\def\bfPsi{{\BS\Psi}} \def\bfOmega{{\BS\Omega}} \ No newline at end of file diff --git a/source_current/rgo_frame.pdf b/source_current/rgo_frame.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ab573733f63cc1853e8f8f87475018ca415a510a Binary files /dev/null and b/source_current/rgo_frame.pdf differ diff --git a/source_current/rgo_lam=10_eps=0.002.pdf b/source_current/rgo_lam=10_eps=0.002.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fa1d25664f9972d2165b92054be4bfcc8adbc2dd Binary files /dev/null and b/source_current/rgo_lam=10_eps=0.002.pdf differ diff --git a/source_current/rgo_lam=10_eps=0.02.pdf b/source_current/rgo_lam=10_eps=0.02.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f42743659e336aafa2b0ce6cf0ac38fa1f9b18d6 Binary files /dev/null and b/source_current/rgo_lam=10_eps=0.02.pdf differ diff --git a/source_current/rgo_lam=10_eps=0.2.pdf b/source_current/rgo_lam=10_eps=0.2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6345403de0d9c6238a08aead1e2ab31b0a49ad3c Binary files /dev/null and b/source_current/rgo_lam=10_eps=0.2.pdf differ diff --git a/source_current/saa_perturb_objective_comparison.pdf b/source_current/saa_perturb_objective_comparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..55142a83de56e84142311482581afc5e19ed9111 Binary files /dev/null and b/source_current/saa_perturb_objective_comparison.pdf differ diff --git a/source_current/svg_frame_0.1.pdf b/source_current/svg_frame_0.1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b75bc0290807d699daca04fcc2a905278c8380b7 Binary files /dev/null and b/source_current/svg_frame_0.1.pdf differ diff --git a/source_current/svg_frame_0.2.pdf b/source_current/svg_frame_0.2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9c81263d18dd38a5a41f3a5fb12987804d0f31b3 Binary files /dev/null and b/source_current/svg_frame_0.2.pdf differ diff --git a/source_current/uncertain_least_squares_results.pdf b/source_current/uncertain_least_squares_results.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fe9df6e95cb5bc9e82682215096e0f5db0bfe6b7 Binary files /dev/null and b/source_current/uncertain_least_squares_results.pdf differ diff --git a/source_current/wfr_frame.pdf b/source_current/wfr_frame.pdf new file mode 100644 index 0000000000000000000000000000000000000000..02ece6fa44206fb103bbe9ef9f4f0bb511504fd5 --- /dev/null +++ b/source_current/wfr_frame.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d1935af30b285970385eca6ad62348ec3b7435b8c02f14901bf561d3792cbe7 +size 260811 diff --git a/source_current/wfr_multi_sample_results.pdf b/source_current/wfr_multi_sample_results.pdf new file mode 100644 index 0000000000000000000000000000000000000000..49ffadcad38a2d0ab55c711277bbc2a0d03c0049 --- /dev/null +++ b/source_current/wfr_multi_sample_results.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dced0ff411affb535f885926966e932ae4ffdbae8b1a26fde50fe4ec122cda33 +size 3161313 diff --git a/source_current/wfr_topk_comparison.pdf b/source_current/wfr_topk_comparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1166fd37052521da85fc1165cc947371a629cb9f --- /dev/null +++ b/source_current/wfr_topk_comparison.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d4eef7bc6543ecc602ce7170e92c3d2ae98ce6c53d2d9757031f49a69addfce +size 2007854 diff --git a/source_current/wgf_frame.pdf b/source_current/wgf_frame.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aa08fff6c39e4e0ae176e057fa01853fe9f9ecd0 Binary files /dev/null and b/source_current/wgf_frame.pdf differ diff --git a/source_current/wrm_frame.pdf b/source_current/wrm_frame.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c2513a5e36cdfffa73236aaa1f5b7484a1deba5b Binary files /dev/null and b/source_current/wrm_frame.pdf differ diff --git a/source_v1.tar.gz b/source_v1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..55eac53e48a7a9961f36abd3ca29598830cafff8 --- /dev/null +++ b/source_v1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35a471bd60c11517db90b8e337064019c5a07faa621718aeca9800d425604488 +size 1589275 diff --git a/source_v1/00README.json b/source_v1/00README.json new file mode 100644 index 0000000000000000000000000000000000000000..6b04f6b95e7a815196340b7cbfc759faa7e9a818 --- /dev/null +++ b/source_v1/00README.json @@ -0,0 +1,17 @@ +{ + "sources" : [ + { + "usage" : "toplevel", + "filename" : "main.tex" + }, + { + "usage" : "ignore", + "filename" : "Bibliography.bib" + } + ], + "spec_version" : 1, + "texlive_version" : "2025", + "process" : { + "compiler" : "pdflatex" + } +} diff --git a/source_v1/2000.pdf b/source_v1/2000.pdf new file mode 100644 index 0000000000000000000000000000000000000000..884d75afe92fd998b55b12eb07881ec1a5a47a9b Binary files /dev/null and b/source_v1/2000.pdf differ diff --git a/source_v1/Bibliography.bib b/source_v1/Bibliography.bib new file mode 100644 index 0000000000000000000000000000000000000000..3d863b6f950cdc9fd7af1d192228408ec433d258 --- /dev/null +++ b/source_v1/Bibliography.bib @@ -0,0 +1,544 @@ +@article{mielkeNotesHellingerDistance2025, + title={Some notes on the Hellinger distance and various Fisher-Rao distances}, + author={Mielke, Alexander}, + journal={arXiv preprint arXiv:2510.02537}, + year={2025} +} + +@article{carrillo2024fisher, + title = {Fisher-rao gradient flow: geodesic convexity and functional inequalities}, + author = {Carrillo, Jos{\'e} A and Chen, Yifan and Huang, Daniel Zhengyu and Huang, Jiaoyang and Wei, Dongyi}, + journal = {arXiv preprint arXiv:2407.15693}, + year = {2024} +} +@article{chen2023sampling, + title = {Sampling via gradient flows in the space of probability measures}, + author = {Chen, Yifan and Huang, Daniel Zhengyu and Huang, Jiaoyang and Reich, Sebastian and Stuart, Andrew M}, + journal = {arXiv preprint arXiv:2310.03597}, + year = {2023} +} +@book{ambrosio2008gradient, + title = {Gradient Flows: {{In}} Metric Spaces and in the Space of Probability Measures}, + author = {Ambrosio, Luigi and Gigli, Nicola and Savare, Giuseppe}, + year = {2005}, + publisher = {Springer Science \& Business Media} +} + +@article{delageDistributionallyRobustOptimization2010, + title = {Distributionally Robust Optimization under Moment Uncertainty with Application to Data-Driven Problems}, + author = {Delage, Erick and Ye, Yinyu}, + year = {2010}, + journal = {Operations research}, + volume = {58}, + number = {3}, + pages = {595--612}, + publisher = {INFORMS} +} + +@article{ben-talRobustSolutionsOptimization2013, + title = {Robust {{Solutions}} of {{Optimization Problems Affected}} by {{Uncertain Probabilities}}}, + author = {{Ben-Tal}, Aharon and {den Hertog}, Dick and De Waegenaere, Anja and Melenberg, Bertrand and Rennen, Gijs}, + year = {2013}, + month = feb, + journal = {Management Science}, + volume = {59}, + number = {2}, + pages = {341--357}, + issn = {0025-1909, 1526-5501}, + doi = {10.1287/mnsc.1120.1641}, + urldate = {2022-03-02}, + langid = {english} +} + +@article{levyLargeScaleMethodsDistributionally2020, + title={Large-scale methods for distributionally robust optimization}, + author={Levy, Daniel and Carmon, Yair and Duchi, John C and Sidford, Aaron}, + journal={Advances in neural information processing systems}, + volume={33}, + pages={8847--8860}, + year={2020} +} + +@article{kuhnDistributionallyRobustOptimization2024, + title={Distributionally robust optimization}, + author={Kuhn, Daniel and Shafiee, Soroosh and Wiesemann, Wolfram}, + journal={Acta Numerica}, + volume={34}, + pages={579--804}, + year={2025}, + publisher={Cambridge University Press} +} + +@article{gallouetJKOSplittingScheme2018, + title = {A {{JKO}} Splitting Scheme for {{Kantorovich-Fisher-Rao}} Gradient Flows}, + author = {Gallou{\"e}t, Thomas and Monsaingeon, L{\'e}onard}, + year = {2018}, + month = may, + number = {arXiv:1602.04457}, + eprint = {1602.04457}, + primaryclass = {math}, + publisher = {arXiv}, + doi = {10.48550/arXiv.1602.04457}, + urldate = {2023-01-15}, + archiveprefix = {arXiv}, + keywords = {35K15 35K57 35K65 47J30,Mathematics - Analysis of PDEs} +} + +@inproceedings{yuFastDistributionallyRobust2022, + title = {Fast {{Distributionally Robust Learning}} with {{Variance-Reduced Min-Max Optimization}}}, + booktitle = {Proceedings of {{The}} 25th {{International Conference}} on {{Artificial Intelligence}} and {{Statistics}}}, + author = {Yu, Yaodong and Lin, Tianyi and Mazumdar, Eric V. and Jordan, Michael}, + year = {2022}, + month = may, + pages = {1219--1250}, + publisher = {PMLR}, + issn = {2640-3498}, + urldate = {2022-07-22}, + langid = {english} +} +@inproceedings{congerStrategicDistributionShift2023, + title = {Strategic {{Distribution Shift}} of {{Interacting Agents}} via {{Coupled Gradient Flows}}}, + booktitle = {Thirty-Seventh {{Conference}} on {{Neural Information Processing Systems}}}, + author = {Conger, Lauren E. and Hoffman, Franca and Mazumdar, Eric and Ratliff, Lillian J.}, + year = {2023}, + month = nov, + urldate = {2023-12-21}, + langid = {english} +} + + +@article{trillosAdversarialRobustnessUse2023, + title={On adversarial robustness and the use of Wasserstein ascent-descent dynamics to enforce it}, + author={Garc{\'\i}a Trillos, Camilo Andr{\'e}s and Garc{\'\i}a Trillos, Nicol{\'a}s}, + journal={Information and Inference: A Journal of the IMA}, + volume={13}, + number={3}, + pages={iaae018}, + year={2024}, + publisher={Oxford University Press} +} + +@article{luAcceleratingLangevinSampling2019, + title={Accelerating Langevin sampling with birth-death}, + author={Lu, Yulong and Lu, Jianfeng and Nolen, James}, + journal={arXiv preprint arXiv:1905.09863}, + year={2019} +} + +@article{luBirthdeathDynamicsSampling2023, + title = {Birth-Death Dynamics for Sampling: {{Global}} Convergence, Approximations and Their Asymptotics}, + shorttitle = {Birth-Death Dynamics for Sampling}, + author = {Lu, Yulong and Slep{\v c}ev, Dejan and Wang, Lihan}, + year = {2023}, + month = nov, + journal = {Nonlinearity}, + volume = {36}, + number = {11}, + eprint = {2211.00450}, + primaryclass = {math, stat}, + pages = {5731--5772}, + issn = {0951-7715, 1361-6544}, + doi = {10.1088/1361-6544/acf988}, + urldate = {2023-12-25}, + archiveprefix = {arXiv}, + keywords = {Mathematics - Analysis of PDEs,Mathematics - Probability,Statistics - Machine Learning} +} +@article{mielke2025hellinger, + title = {Hellinger-Kantorovich gradient flows: Global exponential decay of entropy functionals}, + author = {Mielke, Alexander and Zhu, Jia-Jie}, + journal = {arXiv preprint arXiv:2501.17049}, + year = {2025} +} +@article{wang2022exponentially, + title = {An exponentially converging particle method for the mixed nash equilibrium of continuous games}, + author = {Wang, Guillaume and Chizat, L{\'e}na{\"\i}c}, + journal = {arXiv preprint arXiv:2211.01280}, + year = {2022} +} + +@article{gaoDistributionallyRobustStochastic2016, + title = {Distributionally {{Robust Stochastic Optimization}} with {{Wasserstein Distance}}}, + author = {Gao, Rui and Kleywegt, Anton J.}, + year = {2016}, + journal = {arXiv preprint arXiv:1604.02199}, +} + +@article{zhaoDatadrivenRiskaverseStochastic2018, + title = {Data-Driven Risk-Averse Stochastic Optimization with {{Wasserstein}} Metric}, + author = {Zhao, Chaoyue and Guan, Yongpei}, + year = {2018}, + month = mar, + journal = {Operations Research Letters}, + volume = {46}, + number = {2}, + pages = {262--267}, + issn = {01676377}, + doi = {10.1016/j.orl.2018.01.011}, + urldate = {2022-03-03}, + langid = {english} +} + + +@article{wang2021sinkhorn, + title={Sinkhorn distributionally robust optimization}, + author={Wang, Jie and Gao, Rui and Xie, Yao}, + journal={arXiv preprint arXiv:2109.11926}, + year={2021} +} +@inproceedings{lee2021structured, + title={Structured logconcave sampling with a restricted Gaussian oracle}, + author={Lee, Yin Tat and Shen, Ruoqi and Tian, Kevin}, + booktitle={Conference on Learning Theory}, + pages={2993--3050}, + year={2021}, + organization={PMLR} +} + +@article{sinha2020certifyingdistributionalrobustnessprincipled, + title={Certifying some distributional robustness with principled adversarial training}, + author={Sinha, Aman and Namkoong, Hongseok and Volpi, Riccardo and Duchi, John}, + journal={arXiv preprint arXiv:1710.10571}, + year={2017} +} + +@inproceedings{chen2022improved, + title={Improved analysis for a proximal algorithm for sampling}, + author={Chen, Yongxin and Chewi, Sinho and Salim, Adil and Wibisono, Andre}, + booktitle={Conference on Learning Theory}, + pages={2984--3014}, + year={2022}, + organization={PMLR} +} + +@article{bertsimas2020predictive, + title={From predictive to prescriptive analytics}, + author={Bertsimas, Dimitris and Kallus, Nathan}, + journal={Management Science}, + volume={66}, + number={3}, + pages={1025--1044}, + year={2020}, + publisher={INFORMS} +} + +@article{chewi2024statistical, + title={Statistical optimal transport}, + author={Chewi, Sinho and Niles-Weed, Jonathan and Rigollet, Philippe}, + journal={arXiv preprint arXiv:2407.18163}, + year={2024} +} + +@article{xu2018global, + title={Global convergence of Langevin dynamics based algorithms for nonconvex optimization}, + author={Xu, Pan and Chen, Jinghui and Zou, Difan and Gu, Quanquan}, + journal={Advances in Neural Information Processing Systems}, + volume={31}, + year={2018} +} + +@article{hwang1980laplace, + title={Laplace's method revisited: weak convergence of probability measures}, + author={Hwang, Chii-Ruey}, + journal={The Annals of Probability}, + pages={1177--1182}, + year={1980}, + publisher={JSTOR} +} + +@article{gelfand1991recursive, + title={Recursive stochastic algorithms for global optimization in R\^{}d}, + author={Gelfand, Saul B and Mitter, Sanjoy K}, + journal={SIAM Journal on Control and Optimization}, + volume={29}, + number={5}, + pages={999--1018}, + year={1991}, + publisher={SIAM} +} + +@article{roberts1996exponential, + title={Exponential convergence of Langevin distributions and their discrete approximations}, + author={Roberts, Gareth O and Tweedie, Richard L}, + year={1996} +} + +@article{tan2023accelerate, + title={Accelerate Langevin sampling with birth-death process and exploration component}, + author={Tan, Lezhi and Lu, Jianfeng}, + journal={arXiv preprint arXiv:2305.05529}, + year={2023} +} + +@article{mohajerin2018data, + title={Data-driven distributionally robust optimization using the Wasserstein metric: Performance guarantees and tractable reformulations}, + author={Mohajerin Esfahani, Peyman and Kuhn, Daniel}, + journal={Mathematical Programming}, + volume={171}, + number={1}, + pages={115--166}, + year={2018}, + publisher={Springer} +} + + +@article{nusken2024stein, + title={Stein transport for Bayesian inference}, + author={N{\"u}sken, Nikolas}, + journal={arXiv preprint arXiv:2409.01464}, + year={2024} +} + +@article{liu2016stein, + title={Stein variational gradient descent: A general purpose bayesian inference algorithm}, + author={Liu, Qiang and Wang, Dilin}, + journal={Advances in neural information processing systems}, + volume={29}, + year={2016} +} + +@article{heng2024diffusion, + title={Diffusion schr{\"o}dinger bridges for bayesian computation}, + author={Heng, Jeremy and De Bortoli, Valentin and Doucet, Arnaud}, + journal={Statistical Science}, + volume={39}, + number={1}, + pages={90--99}, + year={2024}, + publisher={Institute of Mathematical Statistics} +} + +@article{hu2013kullback, + title={Kullback-Leibler divergence constrained distributionally robust optimization}, + author={Hu, Zhaolin and Hong, L Jeff}, + journal={Available at Optimization Online}, + volume={1}, + number={2}, + pages={9}, + year={2013} +} + +@article{maurais2024sampling, + title={Sampling in unit time with kernel fisher-rao flow}, + author={Maurais, Aimee and Marzouk, Youssef}, + journal={arXiv preprint arXiv:2401.03892}, + year={2024} +} + +@article{ghadimi2013stochastic, + title={Stochastic first-and zeroth-order methods for nonconvex stochastic programming}, + author={Ghadimi, Saeed and Lan, Guanghui}, + journal={SIAM journal on optimization}, + volume={23}, + number={4}, + pages={2341--2368}, + year={2013}, + publisher={SIAM} +} + +@article{vempala2019rapid, + title={Rapid convergence of the unadjusted langevin algorithm: Isoperimetry suffices}, + author={Vempala, Santosh and Wibisono, Andre}, + journal={Advances in neural information processing systems}, + volume={32}, + year={2019} +} + +@article{otto2000generalization, + title={Generalization of an inequality by Talagrand and links with the logarithmic Sobolev inequality}, + author={Otto, Felix and Villani, C{\'e}dric}, + journal={Journal of Functional Analysis}, + volume={173}, + number={2}, + pages={361--400}, + year={2000}, + publisher={Elsevier} +} + +@article{talagrand1996transportation, + title={Transportation cost for Gaussian and other product measures}, + author={Talagrand, Michel}, + journal={Geometric \& Functional Analysis GAFA}, + volume={6}, + number={3}, + pages={587--600}, + year={1996}, + publisher={Springer} +} + +@article{zhu2024distributionally, + title={Distributionally Robust Optimization via Iterative Algorithms in Continuous Probability Spaces}, + author={Zhu, Linglingzhi and Xie, Yao}, + journal={arXiv preprint arXiv:2412.20556}, + year={2024} +} + +@article{xu2024flow, + title={Flow-based distributionally robust optimization}, + author={Xu, Chen and Lee, Jonghyeok and Cheng, Xiuyuan and Xie, Yao}, + journal={IEEE Journal on Selected Areas in Information Theory}, + volume={5}, + pages={62--77}, + year={2024}, + publisher={IEEE} +} + +@inproceedings{zhu2021kernel, + title={Kernel distributionally robust optimization: Generalized duality theorem and stochastic approximation}, + author={Zhu, Jia-Jie and Jitkrittum, Wittawat and Diehl, Moritz and Sch{\"o}lkopf, Bernhard}, + booktitle={International Conference on Artificial Intelligence and Statistics}, + pages={280--288}, + year={2021}, + organization={PMLR} +} + +@article{el1997robust, + title={Robust solutions to least-squares problems with uncertain data}, + author={El Ghaoui, Laurent and Lebret, Herv{\'e}}, + journal={SIAM Journal on matrix analysis and applications}, + volume={18}, + number={4}, + pages={1035--1064}, + year={1997}, + publisher={SIAM} +} + +@misc{krizhevsky2009learning, + title={Learning multiple layers of features from tiny images.(2009)}, + author={Krizhevsky, Alex and Hinton, Geoffrey and others}, + year={2009} +} + +@book{otto1996double, + title={Double degenerate diffusion equations as steepest descent}, + author={Otto, Felix}, + year={1996}, + publisher={Sonderforschungsbereich 256} +} + +@article{garcia2018continuum, + title={Continuum limits of posteriors in graph Bayesian inverse problems}, + author={Garc{\'\i}a Trillos, Nicolás and Sanz-Alonso, Daniel}, + journal={SIAM Journal on Mathematical Analysis}, + volume={50}, + number={4}, + pages={4020--4040}, + year={2018}, + publisher={SIAM} +} + +@article{onsagerFluctuationsIrreversibleProcesses1953, + title={Fluctuations and irreversible processes}, + author={Onsager, Lars and Machlup, Stefan}, + journal={Physical Review}, + volume={91}, + number={6}, + pages={1505}, + year={1953}, + publisher={APS} +} + +@article{onsagerReciprocalRelationsIrreversible1931, + title={Reciprocal relations in irreversible processes. I.}, + author={Onsager, Lars}, + journal={Physical review}, + volume={37}, + number={4}, + pages={405}, + year={1931}, + publisher={APS} +} + +@article{mielkeNonequilibriumThermodynamicalPrinciples2017, + title={Non-equilibrium thermodynamical principles for chemical reactions with mass-action kinetics}, + author={Mielke, Alexander and Patterson, Robert IA and Peletier, Mark A and Michiel Renger, DR3691731}, + journal={SIAM Journal on Applied Mathematics}, + volume={77}, + number={4}, + pages={1562--1585}, + year={2017}, + publisher={SIAM} +} + +@article{ottoGeometryDissipativeEvolution2001, + title={The geometry of dissipative evolution equations: the porous medium equation}, + author={Otto, Felix}, + year={2001}, + publisher={Taylor \& Francis} +} + +@article{mielke2023introduction, + title={An introduction to the analysis of gradients systems}, + author={Mielke, Alexander}, + journal={arXiv preprint arXiv:2306.05026}, + year={2023} +} + +@article{wibisono2025mixing, + title={Mixing time of the proximal sampler in relative Fisher information via strong data processing inequality}, + author={Wibisono, Andre}, + journal={arXiv preprint arXiv:2502.05623}, + year={2025} +} + +@inproceedings{chewi2022query, + title={The query complexity of sampling from strongly log-concave distributions in one dimension}, + author={Chewi, Sinho and Gerber, Patrik R and Lu, Chen and Le Gouic, Thibaut and Rigollet, Philippe}, + booktitle={Conference on Learning Theory}, + pages={2041--2059}, + year={2022}, + organization={PMLR} +} + +@inproceedings{ba2021understanding, + title={Understanding the variance collapse of SVGD in high dimensions}, + author={Ba, Jimmy and Erdogdu, Murat A and Ghassemi, Marzyeh and Sun, Shengyang and Suzuki, Taiji and Wu, Denny and Zhang, Tianzong}, + booktitle={International Conference on Learning Representations}, + year={2021} +} + +@inproceedings{salim2022convergence, + title={A convergence theory for SVGD in the population limit under Talagrand’s inequality T1}, + author={Salim, Adil and Sun, Lukang and Richtarik, Peter}, + booktitle={International Conference on Machine Learning}, + pages={19139--19152}, + year={2022}, + organization={PMLR} +} + +@inproceedings{zhuo2018message, + title={Message passing Stein variational gradient descent}, + author={Zhuo, Jingwei and Liu, Chang and Shi, Jiaxin and Zhu, Jun and Chen, Ning and Zhang, Bo}, + booktitle={International Conference on Machine Learning}, + pages={6018--6027}, + year={2018}, + organization={PMLR} +} + +@article{shi2023finite, + title={A finite-particle convergence rate for stein variational gradient descent}, + author={Shi, Jiaxin and Mackey, Lester}, + journal={Advances in Neural Information Processing Systems}, + volume={36}, + pages={26831--26844}, + year={2023} +} + +@article{gross1975logarithmic, + title={Logarithmic sobolev inequalities}, + author={Gross, Leonard}, + journal={American Journal of Mathematics}, + volume={97}, + number={4}, + pages={1061--1083}, + year={1975}, + publisher={JSTOR} +} + +@inproceedings{blanchet2015unbiased, + title={Unbiased Monte Carlo for optimization and functions of expectations via multi-level randomization}, + author={Blanchet, Jose H and Glynn, Peter W}, + booktitle={2015 Winter Simulation Conference (WSC)}, + pages={3656--3667}, + year={2015}, + organization={IEEE} +} \ No newline at end of file diff --git a/source_v1/WFR_frame_000_samples.pdf b/source_v1/WFR_frame_000_samples.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a102efc1fd179d7ad2a455215eb296aadbbbd3d0 Binary files /dev/null and b/source_v1/WFR_frame_000_samples.pdf differ diff --git a/source_v1/WRM_frame_000_samples.pdf b/source_v1/WRM_frame_000_samples.pdf new file mode 100644 index 0000000000000000000000000000000000000000..051e6af59c96a0ae09feac77c840d1d7135f8cb3 Binary files /dev/null and b/source_v1/WRM_frame_000_samples.pdf differ diff --git a/source_v1/arxiv.sty b/source_v1/arxiv.sty new file mode 100644 index 0000000000000000000000000000000000000000..afa52249c6299c0e24e62755a1b9a25ca96f823e --- /dev/null +++ b/source_v1/arxiv.sty @@ -0,0 +1,255 @@ +\NeedsTeXFormat{LaTeX2e} + +\ProcessOptions\relax + +% fonts +\renewcommand{\rmdefault}{ptm} +\renewcommand{\sfdefault}{phv} + +% set page geometry +\usepackage[verbose=true,letterpaper]{geometry} +\AtBeginDocument{ + \newgeometry{ + textheight=9in, + textwidth=6.5in, + top=1in, + headheight=14pt, + headsep=25pt, + footskip=30pt + } +} + +\widowpenalty=10000 +\clubpenalty=10000 +\flushbottom +\sloppy + +\usepackage{fancyhdr} +\fancyhf{} +\pagestyle{fancy} +\renewcommand{\headrulewidth}{0pt} +\fancyheadoffset{0pt} +\rhead{\scshape A preprint - \today} +\cfoot{\thepage} + + +%Handling Keywords +\def\keywordname{{\bfseries \emph Keywords}}% +\def\keywords#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm +\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$ +}\noindent\keywordname\enspace\ignorespaces#1\par}} + +% font sizes with reduced leading +\renewcommand{\normalsize}{% + \@setfontsize\normalsize\@xpt\@xipt + \abovedisplayskip 7\p@ \@plus 2\p@ \@minus 5\p@ + \abovedisplayshortskip \z@ \@plus 3\p@ + \belowdisplayskip \abovedisplayskip + \belowdisplayshortskip 4\p@ \@plus 3\p@ \@minus 3\p@ +} +\normalsize +\renewcommand{\small}{% + \@setfontsize\small\@ixpt\@xpt + \abovedisplayskip 6\p@ \@plus 1.5\p@ \@minus 4\p@ + \abovedisplayshortskip \z@ \@plus 2\p@ + \belowdisplayskip \abovedisplayskip + \belowdisplayshortskip 3\p@ \@plus 2\p@ \@minus 2\p@ +} +\renewcommand{\footnotesize}{\@setfontsize\footnotesize\@ixpt\@xpt} +\renewcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt} +\renewcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt} +\renewcommand{\large}{\@setfontsize\large\@xiipt{14}} +\renewcommand{\Large}{\@setfontsize\Large\@xivpt{16}} +\renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{20}} +\renewcommand{\huge}{\@setfontsize\huge\@xxpt{23}} +\renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt{28}} + +% sections with less space +\providecommand{\section}{} +\renewcommand{\section}{% + \@startsection{section}{1}{\z@}% + {-2.0ex \@plus -0.5ex \@minus -0.2ex}% + { 1.5ex \@plus 0.3ex \@minus 0.2ex}% + {\large\bf\raggedright}% +} +\providecommand{\subsection}{} +\renewcommand{\subsection}{% + \@startsection{subsection}{2}{\z@}% + {-1.8ex \@plus -0.5ex \@minus -0.2ex}% + { 0.8ex \@plus 0.2ex}% + {\normalsize\bf\raggedright}% +} +\providecommand{\subsubsection}{} +\renewcommand{\subsubsection}{% + \@startsection{subsubsection}{3}{\z@}% + {-1.5ex \@plus -0.5ex \@minus -0.2ex}% + { 0.5ex \@plus 0.2ex}% + {\normalsize\bf\raggedright}% +} +\providecommand{\paragraph}{} +\renewcommand{\paragraph}{% + \@startsection{paragraph}{4}{\z@}% + {1.5ex \@plus 0.5ex \@minus 0.2ex}% + {-1em}% + {\normalsize\bf}% +} +\providecommand{\subparagraph}{} +\renewcommand{\subparagraph}{% + \@startsection{subparagraph}{5}{\z@}% + {1.5ex \@plus 0.5ex \@minus 0.2ex}% + {-1em}% + {\normalsize\bf}% +} +\providecommand{\subsubsubsection}{} +\renewcommand{\subsubsubsection}{% + \vskip5pt{\noindent\normalsize\rm\raggedright}% +} + +% float placement +\renewcommand{\topfraction }{0.85} +\renewcommand{\bottomfraction }{0.4} +\renewcommand{\textfraction }{0.1} +\renewcommand{\floatpagefraction}{0.7} + +\newlength{\@abovecaptionskip}\setlength{\@abovecaptionskip}{7\p@} +\newlength{\@belowcaptionskip}\setlength{\@belowcaptionskip}{\z@} + +\setlength{\abovecaptionskip}{\@abovecaptionskip} +\setlength{\belowcaptionskip}{\@belowcaptionskip} + +% swap above/belowcaptionskip lengths for tables +\renewenvironment{table} + {\setlength{\abovecaptionskip}{\@belowcaptionskip}% + \setlength{\belowcaptionskip}{\@abovecaptionskip}% + \@float{table}} + {\end@float} + +% footnote formatting +\setlength{\footnotesep }{6.65\p@} +\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@} +\renewcommand{\footnoterule}{\kern-3\p@ \hrule width 12pc \kern 2.6\p@} +\setcounter{footnote}{0} + +% paragraph formatting +\setlength{\parindent}{\z@} +\setlength{\parskip }{5.5\p@} + +% list formatting +\setlength{\topsep }{4\p@ \@plus 1\p@ \@minus 2\p@} +\setlength{\partopsep }{1\p@ \@plus 0.5\p@ \@minus 0.5\p@} +\setlength{\itemsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@} +\setlength{\parsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@} +\setlength{\leftmargin }{3pc} +\setlength{\leftmargini }{\leftmargin} +\setlength{\leftmarginii }{2em} +\setlength{\leftmarginiii}{1.5em} +\setlength{\leftmarginiv }{1.0em} +\setlength{\leftmarginv }{0.5em} +\def\@listi {\leftmargin\leftmargini} +\def\@listii {\leftmargin\leftmarginii + \labelwidth\leftmarginii + \advance\labelwidth-\labelsep + \topsep 2\p@ \@plus 1\p@ \@minus 0.5\p@ + \parsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@ + \itemsep \parsep} +\def\@listiii{\leftmargin\leftmarginiii + \labelwidth\leftmarginiii + \advance\labelwidth-\labelsep + \topsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@ + \parsep \z@ + \partopsep 0.5\p@ \@plus 0\p@ \@minus 0.5\p@ + \itemsep \topsep} +\def\@listiv {\leftmargin\leftmarginiv + \labelwidth\leftmarginiv + \advance\labelwidth-\labelsep} +\def\@listv {\leftmargin\leftmarginv + \labelwidth\leftmarginv + \advance\labelwidth-\labelsep} +\def\@listvi {\leftmargin\leftmarginvi + \labelwidth\leftmarginvi + \advance\labelwidth-\labelsep} + +% create title +\providecommand{\maketitle}{} +\renewcommand{\maketitle}{% + \par + \begingroup + \renewcommand{\thefootnote}{\fnsymbol{footnote}} + % for perfect author name centering + \renewcommand{\@makefnmark}{\hbox to \z@{$^{\@thefnmark}$\hss}} + % The footnote-mark was overlapping the footnote-text, + % added the following to fix this problem (MK) + \long\def\@makefntext##1{% + \parindent 1em\noindent + \hbox to 1.8em{\hss $\m@th ^{\@thefnmark}$}##1 + } + \thispagestyle{empty} + \@maketitle + \@thanks + %\@notice + \endgroup + \let\maketitle\relax + \let\thanks\relax +} + +% rules for title box at top of first page +\newcommand{\@toptitlebar}{ + \hrule height 2\p@ + \vskip 0.25in + \vskip -\parskip% +} +\newcommand{\@bottomtitlebar}{ + \vskip 0.29in + \vskip -\parskip + \hrule height 2\p@ + \vskip 0.09in% +} + +% create title (includes both anonymized and non-anonymized versions) +\providecommand{\@maketitle}{} +\renewcommand{\@maketitle}{% + \vbox{% + \hsize\textwidth + \linewidth\hsize + \vskip 0.1in + \@toptitlebar + \centering + {\LARGE\sc \@title\par} + \@bottomtitlebar + \textsc{}\\ + \vskip 0.1in + \def\And{% + \end{tabular}\hfil\linebreak[0]\hfil% + \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces% + } + \def\AND{% + \end{tabular}\hfil\linebreak[4]\hfil% + \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces% + } + \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\@author\end{tabular}% + \vskip 0.4in \@minus 0.1in \center{\today} \vskip 0.2in + } +} + +% add conference notice to bottom of first page +\newcommand{\ftype@noticebox}{8} +\newcommand{\@notice}{% + % give a bit of extra room back to authors on first page + \enlargethispage{2\baselineskip}% + \@float{noticebox}[b]% + \footnotesize\@noticestring% + \end@float% +} + +% abstract styling +\renewenvironment{abstract} +{ + \centerline + {\large \bfseries \scshape Abstract} + \begin{quote} +} +{ + \end{quote} +} + +\endinput diff --git a/source_v1/boundary_5_0.01.pdf b/source_v1/boundary_5_0.01.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d6a56e6dca99741542a81fb4ada9a9564d84f2eb Binary files /dev/null and b/source_v1/boundary_5_0.01.pdf differ diff --git a/source_v1/circle_boundary_comparison.pdf b/source_v1/circle_boundary_comparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..48474e5a34ac101042c95c1b14134bfc7209fcea Binary files /dev/null and b/source_v1/circle_boundary_comparison.pdf differ diff --git a/source_v1/fancyhdr.sty b/source_v1/fancyhdr.sty new file mode 100644 index 0000000000000000000000000000000000000000..77ed4e3012d822c7cca5c17efcae308b32b8cc2b --- /dev/null +++ b/source_v1/fancyhdr.sty @@ -0,0 +1,485 @@ +% fancyhdr.sty version 3.2 +% Fancy headers and footers for LaTeX. +% Piet van Oostrum, +% Dept of Computer and Information Sciences, University of Utrecht, +% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands +% Telephone: +31 30 2532180. Email: piet@cs.uu.nl +% ======================================================================== +% LICENCE: +% This file may be distributed under the terms of the LaTeX Project Public +% License, as described in lppl.txt in the base LaTeX distribution. +% Either version 1 or, at your option, any later version. +% ======================================================================== +% MODIFICATION HISTORY: +% Sep 16, 1994 +% version 1.4: Correction for use with \reversemargin +% Sep 29, 1994: +% version 1.5: Added the \iftopfloat, \ifbotfloat and \iffloatpage commands +% Oct 4, 1994: +% version 1.6: Reset single spacing in headers/footers for use with +% setspace.sty or doublespace.sty +% Oct 4, 1994: +% version 1.7: changed \let\@mkboth\markboth to +% \def\@mkboth{\protect\markboth} to make it more robust +% Dec 5, 1994: +% version 1.8: corrections for amsbook/amsart: define \@chapapp and (more +% importantly) use the \chapter/sectionmark definitions from ps@headings if +% they exist (which should be true for all standard classes). +% May 31, 1995: +% version 1.9: The proposed \renewcommand{\headrulewidth}{\iffloatpage... +% construction in the doc did not work properly with the fancyplain style. +% June 1, 1995: +% version 1.91: The definition of \@mkboth wasn't restored on subsequent +% \pagestyle{fancy}'s. +% June 1, 1995: +% version 1.92: The sequence \pagestyle{fancyplain} \pagestyle{plain} +% \pagestyle{fancy} would erroneously select the plain version. +% June 1, 1995: +% version 1.93: \fancypagestyle command added. +% Dec 11, 1995: +% version 1.94: suggested by Conrad Hughes +% CJCH, Dec 11, 1995: added \footruleskip to allow control over footrule +% position (old hardcoded value of .3\normalbaselineskip is far too high +% when used with very small footer fonts). +% Jan 31, 1996: +% version 1.95: call \@normalsize in the reset code if that is defined, +% otherwise \normalsize. +% this is to solve a problem with ucthesis.cls, as this doesn't +% define \@currsize. Unfortunately for latex209 calling \normalsize doesn't +% work as this is optimized to do very little, so there \@normalsize should +% be called. Hopefully this code works for all versions of LaTeX known to +% mankind. +% April 25, 1996: +% version 1.96: initialize \headwidth to a magic (negative) value to catch +% most common cases that people change it before calling \pagestyle{fancy}. +% Note it can't be initialized when reading in this file, because +% \textwidth could be changed afterwards. This is quite probable. +% We also switch to \MakeUppercase rather than \uppercase and introduce a +% \nouppercase command for use in headers. and footers. +% May 3, 1996: +% version 1.97: Two changes: +% 1. Undo the change in version 1.8 (using the pagestyle{headings} defaults +% for the chapter and section marks. The current version of amsbook and +% amsart classes don't seem to need them anymore. Moreover the standard +% latex classes don't use \markboth if twoside isn't selected, and this is +% confusing as \leftmark doesn't work as expected. +% 2. include a call to \ps@empty in ps@@fancy. This is to solve a problem +% in the amsbook and amsart classes, that make global changes to \topskip, +% which are reset in \ps@empty. Hopefully this doesn't break other things. +% May 7, 1996: +% version 1.98: +% Added % after the line \def\nouppercase +% May 7, 1996: +% version 1.99: This is the alpha version of fancyhdr 2.0 +% Introduced the new commands \fancyhead, \fancyfoot, and \fancyhf. +% Changed \headrulewidth, \footrulewidth, \footruleskip to +% macros rather than length parameters, In this way they can be +% conditionalized and they don't consume length registers. There is no need +% to have them as length registers unless you want to do calculations with +% them, which is unlikely. Note that this may make some uses of them +% incompatible (i.e. if you have a file that uses \setlength or \xxxx=) +% May 10, 1996: +% version 1.99a: +% Added a few more % signs +% May 10, 1996: +% version 1.99b: +% Changed the syntax of \f@nfor to be resistent to catcode changes of := +% Removed the [1] from the defs of \lhead etc. because the parameter is +% consumed by the \@[xy]lhead etc. macros. +% June 24, 1997: +% version 1.99c: +% corrected \nouppercase to also include the protected form of \MakeUppercase +% \global added to manipulation of \headwidth. +% \iffootnote command added. +% Some comments added about \@fancyhead and \@fancyfoot. +% Aug 24, 1998 +% version 1.99d +% Changed the default \ps@empty to \ps@@empty in order to allow +% \fancypagestyle{empty} redefinition. +% Oct 11, 2000 +% version 2.0 +% Added LPPL license clause. +% +% A check for \headheight is added. An errormessage is given (once) if the +% header is too large. Empty headers don't generate the error even if +% \headheight is very small or even 0pt. +% Warning added for the use of 'E' option when twoside option is not used. +% In this case the 'E' fields will never be used. +% +% Mar 10, 2002 +% version 2.1beta +% New command: \fancyhfoffset[place]{length} +% defines offsets to be applied to the header/footer to let it stick into +% the margins (if length > 0). +% place is like in fancyhead, except that only E,O,L,R can be used. +% This replaces the old calculation based on \headwidth and the marginpar +% area. +% \headwidth will be dynamically calculated in the headers/footers when +% this is used. +% +% Mar 26, 2002 +% version 2.1beta2 +% \fancyhfoffset now also takes h,f as possible letters in the argument to +% allow the header and footer widths to be different. +% New commands \fancyheadoffset and \fancyfootoffset added comparable to +% \fancyhead and \fancyfoot. +% Errormessages and warnings have been made more informative. +% +% Dec 9, 2002 +% version 2.1 +% The defaults for \footrulewidth, \plainheadrulewidth and +% \plainfootrulewidth are changed from \z@skip to 0pt. In this way when +% someone inadvertantly uses \setlength to change any of these, the value +% of \z@skip will not be changed, rather an errormessage will be given. + +% March 3, 2004 +% Release of version 3.0 + +% Oct 7, 2004 +% version 3.1 +% Added '\endlinechar=13' to \fancy@reset to prevent problems with +% includegraphics in header when verbatiminput is active. + +% March 22, 2005 +% version 3.2 +% reset \everypar (the real one) in \fancy@reset because spanish.ldf does +% strange things with \everypar between << and >>. + +\def\ifancy@mpty#1{\def\temp@a{#1}\ifx\temp@a\@empty} + +\def\fancy@def#1#2{\ifancy@mpty{#2}\fancy@gbl\def#1{\leavevmode}\else + \fancy@gbl\def#1{#2\strut}\fi} + +\let\fancy@gbl\global + +\def\@fancyerrmsg#1{% + \ifx\PackageError\undefined + \errmessage{#1}\else + \PackageError{Fancyhdr}{#1}{}\fi} +\def\@fancywarning#1{% + \ifx\PackageWarning\undefined + \errmessage{#1}\else + \PackageWarning{Fancyhdr}{#1}{}\fi} + +% Usage: \@forc \var{charstring}{command to be executed for each char} +% This is similar to LaTeX's \@tfor, but expands the charstring. + +\def\@forc#1#2#3{\expandafter\f@rc\expandafter#1\expandafter{#2}{#3}} +\def\f@rc#1#2#3{\def\temp@ty{#2}\ifx\@empty\temp@ty\else + \f@@rc#1#2\f@@rc{#3}\fi} +\def\f@@rc#1#2#3\f@@rc#4{\def#1{#2}#4\f@rc#1{#3}{#4}} + +% Usage: \f@nfor\name:=list\do{body} +% Like LaTeX's \@for but an empty list is treated as a list with an empty +% element + +\newcommand{\f@nfor}[3]{\edef\@fortmp{#2}% + \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}} + +% Usage: \def@ult \cs{defaults}{argument} +% sets \cs to the characters from defaults appearing in argument +% or defaults if it would be empty. All characters are lowercased. + +\newcommand\def@ult[3]{% + \edef\temp@a{\lowercase{\edef\noexpand\temp@a{#3}}}\temp@a + \def#1{}% + \@forc\tmpf@ra{#2}% + {\expandafter\if@in\tmpf@ra\temp@a{\edef#1{#1\tmpf@ra}}{}}% + \ifx\@empty#1\def#1{#2}\fi} +% +% \if@in +% +\newcommand{\if@in}[4]{% + \edef\temp@a{#2}\def\temp@b##1#1##2\temp@b{\def\temp@b{##1}}% + \expandafter\temp@b#2#1\temp@b\ifx\temp@a\temp@b #4\else #3\fi} + +\newcommand{\fancyhead}{\@ifnextchar[{\f@ncyhf\fancyhead h}% + {\f@ncyhf\fancyhead h[]}} +\newcommand{\fancyfoot}{\@ifnextchar[{\f@ncyhf\fancyfoot f}% + {\f@ncyhf\fancyfoot f[]}} +\newcommand{\fancyhf}{\@ifnextchar[{\f@ncyhf\fancyhf{}}% + {\f@ncyhf\fancyhf{}[]}} + +% New commands for offsets added + +\newcommand{\fancyheadoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyheadoffset h}% + {\f@ncyhfoffs\fancyheadoffset h[]}} +\newcommand{\fancyfootoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyfootoffset f}% + {\f@ncyhfoffs\fancyfootoffset f[]}} +\newcommand{\fancyhfoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyhfoffset{}}% + {\f@ncyhfoffs\fancyhfoffset{}[]}} + +% The header and footer fields are stored in command sequences with +% names of the form: \f@ncy with for [eo], from [lcr] +% and from [hf]. + +\def\f@ncyhf#1#2[#3]#4{% + \def\temp@c{}% + \@forc\tmpf@ra{#3}% + {\expandafter\if@in\tmpf@ra{eolcrhf,EOLCRHF}% + {}{\edef\temp@c{\temp@c\tmpf@ra}}}% + \ifx\@empty\temp@c\else + \@fancyerrmsg{Illegal char `\temp@c' in \string#1 argument: + [#3]}% + \fi + \f@nfor\temp@c{#3}% + {\def@ult\f@@@eo{eo}\temp@c + \if@twoside\else + \if\f@@@eo e\@fancywarning + {\string#1's `E' option without twoside option is useless}\fi\fi + \def@ult\f@@@lcr{lcr}\temp@c + \def@ult\f@@@hf{hf}{#2\temp@c}% + \@forc\f@@eo\f@@@eo + {\@forc\f@@lcr\f@@@lcr + {\@forc\f@@hf\f@@@hf + {\expandafter\fancy@def\csname + f@ncy\f@@eo\f@@lcr\f@@hf\endcsname + {#4}}}}}} + +\def\f@ncyhfoffs#1#2[#3]#4{% + \def\temp@c{}% + \@forc\tmpf@ra{#3}% + {\expandafter\if@in\tmpf@ra{eolrhf,EOLRHF}% + {}{\edef\temp@c{\temp@c\tmpf@ra}}}% + \ifx\@empty\temp@c\else + \@fancyerrmsg{Illegal char `\temp@c' in \string#1 argument: + [#3]}% + \fi + \f@nfor\temp@c{#3}% + {\def@ult\f@@@eo{eo}\temp@c + \if@twoside\else + \if\f@@@eo e\@fancywarning + {\string#1's `E' option without twoside option is useless}\fi\fi + \def@ult\f@@@lcr{lr}\temp@c + \def@ult\f@@@hf{hf}{#2\temp@c}% + \@forc\f@@eo\f@@@eo + {\@forc\f@@lcr\f@@@lcr + {\@forc\f@@hf\f@@@hf + {\expandafter\setlength\csname + f@ncyO@\f@@eo\f@@lcr\f@@hf\endcsname + {#4}}}}}% + \fancy@setoffs} + +% Fancyheadings version 1 commands. These are more or less deprecated, +% but they continue to work. + +\newcommand{\lhead}{\@ifnextchar[{\@xlhead}{\@ylhead}} +\def\@xlhead[#1]#2{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#2}} +\def\@ylhead#1{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#1}} + +\newcommand{\chead}{\@ifnextchar[{\@xchead}{\@ychead}} +\def\@xchead[#1]#2{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#2}} +\def\@ychead#1{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#1}} + +\newcommand{\rhead}{\@ifnextchar[{\@xrhead}{\@yrhead}} +\def\@xrhead[#1]#2{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#2}} +\def\@yrhead#1{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#1}} + +\newcommand{\lfoot}{\@ifnextchar[{\@xlfoot}{\@ylfoot}} +\def\@xlfoot[#1]#2{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#2}} +\def\@ylfoot#1{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#1}} + +\newcommand{\cfoot}{\@ifnextchar[{\@xcfoot}{\@ycfoot}} +\def\@xcfoot[#1]#2{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#2}} +\def\@ycfoot#1{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#1}} + +\newcommand{\rfoot}{\@ifnextchar[{\@xrfoot}{\@yrfoot}} +\def\@xrfoot[#1]#2{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#2}} +\def\@yrfoot#1{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#1}} + +\newlength{\fancy@headwidth} +\let\headwidth\fancy@headwidth +\newlength{\f@ncyO@elh} +\newlength{\f@ncyO@erh} +\newlength{\f@ncyO@olh} +\newlength{\f@ncyO@orh} +\newlength{\f@ncyO@elf} +\newlength{\f@ncyO@erf} +\newlength{\f@ncyO@olf} +\newlength{\f@ncyO@orf} +\newcommand{\headrulewidth}{0.4pt} +\newcommand{\footrulewidth}{0pt} +\newcommand{\footruleskip}{.3\normalbaselineskip} + +% Fancyplain stuff shouldn't be used anymore (rather +% \fancypagestyle{plain} should be used), but it must be present for +% compatibility reasons. + +\newcommand{\plainheadrulewidth}{0pt} +\newcommand{\plainfootrulewidth}{0pt} +\newif\if@fancyplain \@fancyplainfalse +\def\fancyplain#1#2{\if@fancyplain#1\else#2\fi} + +\headwidth=-123456789sp %magic constant + +% Command to reset various things in the headers: +% a.o. single spacing (taken from setspace.sty) +% and the catcode of ^^M (so that epsf files in the header work if a +% verbatim crosses a page boundary) +% It also defines a \nouppercase command that disables \uppercase and +% \Makeuppercase. It can only be used in the headers and footers. +\let\fnch@everypar\everypar% save real \everypar because of spanish.ldf +\def\fancy@reset{\fnch@everypar{}\restorecr\endlinechar=13 + \def\baselinestretch{1}% + \def\nouppercase##1{{\let\uppercase\relax\let\MakeUppercase\relax + \expandafter\let\csname MakeUppercase \endcsname\relax##1}}% + \ifx\undefined\@newbaseline% NFSS not present; 2.09 or 2e + \ifx\@normalsize\undefined \normalsize % for ucthesis.cls + \else \@normalsize \fi + \else% NFSS (2.09) present + \@newbaseline% + \fi} + +% Initialization of the head and foot text. + +% The default values still contain \fancyplain for compatibility. +\fancyhf{} % clear all +% lefthead empty on ``plain'' pages, \rightmark on even, \leftmark on odd pages +% evenhead empty on ``plain'' pages, \leftmark on even, \rightmark on odd pages +\if@twoside + \fancyhead[el,or]{\fancyplain{}{\sl\rightmark}} + \fancyhead[er,ol]{\fancyplain{}{\sl\leftmark}} +\else + \fancyhead[l]{\fancyplain{}{\sl\rightmark}} + \fancyhead[r]{\fancyplain{}{\sl\leftmark}} +\fi +\fancyfoot[c]{\rm\thepage} % page number + +% Use box 0 as a temp box and dimen 0 as temp dimen. +% This can be done, because this code will always +% be used inside another box, and therefore the changes are local. + +\def\@fancyvbox#1#2{\setbox0\vbox{#2}\ifdim\ht0>#1\@fancywarning + {\string#1 is too small (\the#1): ^^J Make it at least \the\ht0.^^J + We now make it that large for the rest of the document.^^J + This may cause the page layout to be inconsistent, however\@gobble}% + \dimen0=#1\global\setlength{#1}{\ht0}\ht0=\dimen0\fi + \box0} + +% Put together a header or footer given the left, center and +% right text, fillers at left and right and a rule. +% The \lap commands put the text into an hbox of zero size, +% so overlapping text does not generate an errormessage. +% These macros have 5 parameters: +% 1. LEFTSIDE BEARING % This determines at which side the header will stick +% out. When \fancyhfoffset is used this calculates \headwidth, otherwise +% it is \hss or \relax (after expansion). +% 2. \f@ncyolh, \f@ncyelh, \f@ncyolf or \f@ncyelf. This is the left component. +% 3. \f@ncyoch, \f@ncyech, \f@ncyocf or \f@ncyecf. This is the middle comp. +% 4. \f@ncyorh, \f@ncyerh, \f@ncyorf or \f@ncyerf. This is the right component. +% 5. RIGHTSIDE BEARING. This is always \relax or \hss (after expansion). + +\def\@fancyhead#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset + \@fancyvbox\headheight{\hbox + {\rlap{\parbox[b]{\headwidth}{\raggedright#2}}\hfill + \parbox[b]{\headwidth}{\centering#3}\hfill + \llap{\parbox[b]{\headwidth}{\raggedleft#4}}}\headrule}}#5} + +\def\@fancyfoot#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset + \@fancyvbox\footskip{\footrule + \hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2}}\hfill + \parbox[t]{\headwidth}{\centering#3}\hfill + \llap{\parbox[t]{\headwidth}{\raggedleft#4}}}}}#5} + +\def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi + \hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}} + +\def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi + \vskip-\footruleskip\vskip-\footrulewidth + \hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}} + +\def\ps@fancy{% +\@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook +% +% Define \MakeUppercase for old LaTeXen. +% Note: we used \def rather than \let, so that \let\uppercase\relax (from +% the version 1 documentation) will still work. +% +\@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}% +\@ifundefined{chapter}{\def\sectionmark##1{\markboth +{\MakeUppercase{\ifnum \c@secnumdepth>\z@ + \thesection\hskip 1em\relax \fi ##1}}{}}% +\def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne + \thesubsection\hskip 1em\relax \fi ##1}}}% +{\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\m@ne + \@chapapp\ \thechapter. \ \fi ##1}}{}}% +\def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@ + \thesection. \ \fi ##1}}}}% +%\csname ps@headings\endcsname % use \ps@headings defaults if they exist +\ps@@fancy +\gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}% +% Initialize \headwidth if the user didn't +% +\ifdim\headwidth<0sp +% +% This catches the case that \headwidth hasn't been initialized and the +% case that the user added something to \headwidth in the expectation that +% it was initialized to \textwidth. We compensate this now. This loses if +% the user intended to multiply it by a factor. But that case is more +% likely done by saying something like \headwidth=1.2\textwidth. +% The doc says you have to change \headwidth after the first call to +% \pagestyle{fancy}. This code is just to catch the most common cases were +% that requirement is violated. +% + \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth +\fi} +\def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy} +\def\ps@plain@fancy{\@fancyplaintrue\ps@@fancy} +\let\ps@@empty\ps@empty +\def\ps@@fancy{% +\ps@@empty % This is for amsbook/amsart, which do strange things with \topskip +\def\@mkboth{\protect\markboth}% +\def\@oddhead{\@fancyhead\fancy@Oolh\f@ncyolh\f@ncyoch\f@ncyorh\fancy@Oorh}% +\def\@oddfoot{\@fancyfoot\fancy@Oolf\f@ncyolf\f@ncyocf\f@ncyorf\fancy@Oorf}% +\def\@evenhead{\@fancyhead\fancy@Oelh\f@ncyelh\f@ncyech\f@ncyerh\fancy@Oerh}% +\def\@evenfoot{\@fancyfoot\fancy@Oelf\f@ncyelf\f@ncyecf\f@ncyerf\fancy@Oerf}% +} +% Default definitions for compatibility mode: +% These cause the header/footer to take the defined \headwidth as width +% And to shift in the direction of the marginpar area + +\def\fancy@Oolh{\if@reversemargin\hss\else\relax\fi} +\def\fancy@Oorh{\if@reversemargin\relax\else\hss\fi} +\let\fancy@Oelh\fancy@Oorh +\let\fancy@Oerh\fancy@Oolh + +\let\fancy@Oolf\fancy@Oolh +\let\fancy@Oorf\fancy@Oorh +\let\fancy@Oelf\fancy@Oelh +\let\fancy@Oerf\fancy@Oerh + +% New definitions for the use of \fancyhfoffset +% These calculate the \headwidth from \textwidth and the specified offsets. + +\def\fancy@offsolh{\headwidth=\textwidth\advance\headwidth\f@ncyO@olh + \advance\headwidth\f@ncyO@orh\hskip-\f@ncyO@olh} +\def\fancy@offselh{\headwidth=\textwidth\advance\headwidth\f@ncyO@elh + \advance\headwidth\f@ncyO@erh\hskip-\f@ncyO@elh} + +\def\fancy@offsolf{\headwidth=\textwidth\advance\headwidth\f@ncyO@olf + \advance\headwidth\f@ncyO@orf\hskip-\f@ncyO@olf} +\def\fancy@offself{\headwidth=\textwidth\advance\headwidth\f@ncyO@elf + \advance\headwidth\f@ncyO@erf\hskip-\f@ncyO@elf} + +\def\fancy@setoffs{% +% Just in case \let\headwidth\textwidth was used + \fancy@gbl\let\headwidth\fancy@headwidth + \fancy@gbl\let\fancy@Oolh\fancy@offsolh + \fancy@gbl\let\fancy@Oelh\fancy@offselh + \fancy@gbl\let\fancy@Oorh\hss + \fancy@gbl\let\fancy@Oerh\hss + \fancy@gbl\let\fancy@Oolf\fancy@offsolf + \fancy@gbl\let\fancy@Oelf\fancy@offself + \fancy@gbl\let\fancy@Oorf\hss + \fancy@gbl\let\fancy@Oerf\hss} + +\newif\iffootnote +\let\latex@makecol\@makecol +\def\@makecol{\ifvoid\footins\footnotetrue\else\footnotefalse\fi +\let\topfloat\@toplist\let\botfloat\@botlist\latex@makecol} +\def\iftopfloat#1#2{\ifx\topfloat\empty #2\else #1\fi} +\def\ifbotfloat#1#2{\ifx\botfloat\empty #2\else #1\fi} +\def\iffloatpage#1#2{\if@fcolmade #1\else #2\fi} + +\newcommand{\fancypagestyle}[2]{% + \@namedef{ps@#1}{\let\fancy@gbl\relax#2\relax\ps@fancy}} diff --git a/source_v1/frame_020.pdf b/source_v1/frame_020.pdf new file mode 100644 index 0000000000000000000000000000000000000000..48f2461304d82e1c1ef62029ebef342021aea1f3 --- /dev/null +++ b/source_v1/frame_020.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e3af5d048af03dbf2ee22560590d19dae055c7ec68a6bd4c710bdebe32390d8 +size 318534 diff --git a/source_v1/frame_100.pdf b/source_v1/frame_100.pdf new file mode 100644 index 0000000000000000000000000000000000000000..87bb3da6afdec8e0923c740c6baa147458190819 --- /dev/null +++ b/source_v1/frame_100.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d33e3ee01f8df8e37d3cda6a806c5574b4e1d97e956efedb87e728429169173c +size 319738 diff --git a/source_v1/frame_288.pdf b/source_v1/frame_288.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e149d3d62ceffef8fa0ac4e8d495920d53f05473 --- /dev/null +++ b/source_v1/frame_288.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d19fcf87c2ff1af69accaeb6b2b6b699a2ae72fce656f42576275e1a4d3b034 +size 319642 diff --git a/source_v1/main.bbl b/source_v1/main.bbl new file mode 100644 index 0000000000000000000000000000000000000000..ec4bb4506d6953f1dba8d85cd88b0431bf978ee2 --- /dev/null +++ b/source_v1/main.bbl @@ -0,0 +1,212 @@ +\begin{thebibliography}{} + +\bibitem[Ambrosio et~al., 2005]{ambrosio2008gradient} +Ambrosio, L., Gigli, N., and Savare, G. (2005). +\newblock {\em Gradient Flows: {{In}} Metric Spaces and in the Space of Probability Measures}. +\newblock Springer Science \& Business Media. + +\bibitem[Ba et~al., 2021]{ba2021understanding} +Ba, J., Erdogdu, M.~A., Ghassemi, M., Sun, S., Suzuki, T., Wu, D., and Zhang, T. (2021). +\newblock Understanding the variance collapse of svgd in high dimensions. +\newblock In {\em International Conference on Learning Representations}. + +\bibitem[{Ben-Tal} et~al., 2013]{ben-talRobustSolutionsOptimization2013} +{Ben-Tal}, A., {den Hertog}, D., De~Waegenaere, A., Melenberg, B., and Rennen, G. (2013). +\newblock Robust {{Solutions}} of {{Optimization Problems Affected}} by {{Uncertain Probabilities}}. +\newblock {\em Management Science}, 59(2):341--357. + +\bibitem[Blanchet and Glynn, 2015]{blanchet2015unbiased} +Blanchet, J.~H. and Glynn, P.~W. (2015). +\newblock Unbiased monte carlo for optimization and functions of expectations via multi-level randomization. +\newblock In {\em 2015 Winter Simulation Conference (WSC)}, pages 3656--3667. IEEE. + +\bibitem[Carrillo et~al., 2024]{carrillo2024fisher} +Carrillo, J.~A., Chen, Y., Huang, D.~Z., Huang, J., and Wei, D. (2024). +\newblock Fisher-rao gradient flow: geodesic convexity and functional inequalities. +\newblock {\em arXiv preprint arXiv:2407.15693}. + +\bibitem[Chen et~al., 2022]{chen2022improved} +Chen, Y., Chewi, S., Salim, A., and Wibisono, A. (2022). +\newblock Improved analysis for a proximal algorithm for sampling. +\newblock In {\em Conference on Learning Theory}, pages 2984--3014. PMLR. + +\bibitem[Chen et~al., 2023]{chen2023sampling} +Chen, Y., Huang, D.~Z., Huang, J., Reich, S., and Stuart, A.~M. (2023). +\newblock Sampling via gradient flows in the space of probability measures. +\newblock {\em arXiv preprint arXiv:2310.03597}. + +\bibitem[Chewi et~al., 2022]{chewi2022query} +Chewi, S., Gerber, P.~R., Lu, C., Le~Gouic, T., and Rigollet, P. (2022). +\newblock The query complexity of sampling from strongly log-concave distributions in one dimension. +\newblock In {\em Conference on Learning Theory}, pages 2041--2059. PMLR. + +\bibitem[Chewi et~al., 2024]{chewi2024statistical} +Chewi, S., Niles-Weed, J., and Rigollet, P. (2024). +\newblock Statistical optimal transport. +\newblock {\em arXiv preprint arXiv:2407.18163}. + +\bibitem[Conger et~al., 2023]{congerStrategicDistributionShift2023} +Conger, L.~E., Hoffman, F., Mazumdar, E., and Ratliff, L.~J. (2023). +\newblock Strategic {{Distribution Shift}} of {{Interacting Agents}} via {{Coupled Gradient Flows}}. +\newblock In {\em Thirty-Seventh {{Conference}} on {{Neural Information Processing Systems}}}. + +\bibitem[Delage and Ye, 2010]{delageDistributionallyRobustOptimization2010} +Delage, E. and Ye, Y. (2010). +\newblock Distributionally robust optimization under moment uncertainty with application to data-driven problems. +\newblock {\em Operations research}, 58(3):595--612. + +\bibitem[El~Ghaoui and Lebret, 1997]{el1997robust} +El~Ghaoui, L. and Lebret, H. (1997). +\newblock Robust solutions to least-squares problems with uncertain data. +\newblock {\em SIAM Journal on matrix analysis and applications}, 18(4):1035--1064. + +\bibitem[Gao and Kleywegt, 2016]{gaoDistributionallyRobustStochastic2016} +Gao, R. and Kleywegt, A.~J. (2016). +\newblock Distributionally {{Robust Stochastic Optimization}} with {{Wasserstein Distance}}. +\newblock {\em arXiv preprint arXiv:1604.02199}. + +\bibitem[Garc{\'\i}a~Trillos and Garc{\'\i}a~Trillos, 2024]{trillosAdversarialRobustnessUse2023} +Garc{\'\i}a~Trillos, C.~A. and Garc{\'\i}a~Trillos, N. (2024). +\newblock On adversarial robustness and the use of wasserstein ascent-descent dynamics to enforce it. +\newblock {\em Information and Inference: A Journal of the IMA}, 13(3):iaae018. + +\bibitem[Garc{\'\i}a~Trillos and Sanz-Alonso, 2018]{garcia2018continuum} +Garc{\'\i}a~Trillos, N. and Sanz-Alonso, D. (2018). +\newblock Continuum limits of posteriors in graph bayesian inverse problems. +\newblock {\em SIAM Journal on Mathematical Analysis}, 50(4):4020--4040. + +\bibitem[Ghadimi and Lan, 2013]{ghadimi2013stochastic} +Ghadimi, S. and Lan, G. (2013). +\newblock Stochastic first-and zeroth-order methods for nonconvex stochastic programming. +\newblock {\em SIAM journal on optimization}, 23(4):2341--2368. + +\bibitem[Gross, 1975]{gross1975logarithmic} +Gross, L. (1975). +\newblock Logarithmic sobolev inequalities. +\newblock {\em American Journal of Mathematics}, 97(4):1061--1083. + +\bibitem[Hu and Hong, 2013]{hu2013kullback} +Hu, Z. and Hong, L.~J. (2013). +\newblock Kullback-leibler divergence constrained distributionally robust optimization. +\newblock {\em Available at Optimization Online}, 1(2):9. + +\bibitem[Krizhevsky et~al., 2009]{krizhevsky2009learning} +Krizhevsky, A., Hinton, G., et~al. (2009). +\newblock Learning multiple layers of features from tiny images.(2009). + +\bibitem[Kuhn et~al., 2025]{kuhnDistributionallyRobustOptimization2024} +Kuhn, D., Shafiee, S., and Wiesemann, W. (2025). +\newblock Distributionally robust optimization. +\newblock {\em Acta Numerica}, 34:579--804. + +\bibitem[Lee et~al., 2021]{lee2021structured} +Lee, Y.~T., Shen, R., and Tian, K. (2021). +\newblock Structured logconcave sampling with a restricted gaussian oracle. +\newblock In {\em Conference on Learning Theory}, pages 2993--3050. PMLR. + +\bibitem[Levy et~al., 2020]{levyLargeScaleMethodsDistributionally2020} +Levy, D., Carmon, Y., Duchi, J.~C., and Sidford, A. (2020). +\newblock Large-scale methods for distributionally robust optimization. +\newblock {\em Advances in neural information processing systems}, 33:8847--8860. + +\bibitem[Liu and Wang, 2016]{liu2016stein} +Liu, Q. and Wang, D. (2016). +\newblock Stein variational gradient descent: A general purpose bayesian inference algorithm. +\newblock {\em Advances in neural information processing systems}, 29. + +\bibitem[Lu et~al., 2019]{luAcceleratingLangevinSampling2019} +Lu, Y., Lu, J., and Nolen, J. (2019). +\newblock Accelerating langevin sampling with birth-death. +\newblock {\em arXiv preprint arXiv:1905.09863}. + +\bibitem[Lu et~al., 2023]{luBirthdeathDynamicsSampling2023} +Lu, Y., Slep{\v c}ev, D., and Wang, L. (2023). +\newblock Birth-death dynamics for sampling: {{Global}} convergence, approximations and their asymptotics. +\newblock {\em Nonlinearity}, 36(11):5731--5772. + +\bibitem[Mielke, 2023]{mielke2023introduction} +Mielke, A. (2023). +\newblock An introduction to the analysis of gradients systems. +\newblock {\em arXiv preprint arXiv:2306.05026}. + +\bibitem[Mielke, 2025]{mielkeNotesHellingerDistance2025} +Mielke, A. (2025). +\newblock Some notes on the hellinger distance and various fisher-rao distances. +\newblock {\em arXiv preprint arXiv:2510.02537}. + +\bibitem[Mielke and Zhu, 2025]{mielke2025hellinger} +Mielke, A. and Zhu, J.-J. (2025). +\newblock Hellinger-kantorovich gradient flows: Global exponential decay of entropy functionals. +\newblock {\em arXiv preprint arXiv:2501.17049}. + +\bibitem[Mohajerin~Esfahani and Kuhn, 2018]{mohajerin2018data} +Mohajerin~Esfahani, P. and Kuhn, D. (2018). +\newblock Data-driven distributionally robust optimization using the wasserstein metric: Performance guarantees and tractable reformulations. +\newblock {\em Mathematical Programming}, 171(1):115--166. + +\bibitem[Otto, 1996]{otto1996double} +Otto, F. (1996). +\newblock {\em Double degenerate diffusion equations as steepest descent}. +\newblock Sonderforschungsbereich 256. + +\bibitem[Salim et~al., 2022]{salim2022convergence} +Salim, A., Sun, L., and Richtarik, P. (2022). +\newblock A convergence theory for svgd in the population limit under talagrand’s inequality t1. +\newblock In {\em International Conference on Machine Learning}, pages 19139--19152. PMLR. + +\bibitem[Shi and Mackey, 2023]{shi2023finite} +Shi, J. and Mackey, L. (2023). +\newblock A finite-particle convergence rate for stein variational gradient descent. +\newblock {\em Advances in Neural Information Processing Systems}, 36:26831--26844. + +\bibitem[Sinha et~al., 2017]{sinha2020certifyingdistributionalrobustnessprincipled} +Sinha, A., Namkoong, H., Volpi, R., and Duchi, J. (2017). +\newblock Certifying some distributional robustness with principled adversarial training. +\newblock {\em arXiv preprint arXiv:1710.10571}. + +\bibitem[Vempala and Wibisono, 2019]{vempala2019rapid} +Vempala, S. and Wibisono, A. (2019). +\newblock Rapid convergence of the unadjusted langevin algorithm: Isoperimetry suffices. +\newblock {\em Advances in neural information processing systems}, 32. + +\bibitem[Wang and Chizat, 2022]{wang2022exponentially} +Wang, G. and Chizat, L. (2022). +\newblock An exponentially converging particle method for the mixed nash equilibrium of continuous games. +\newblock {\em arXiv preprint arXiv:2211.01280}. + +\bibitem[Wang et~al., 2021]{wang2021sinkhorn} +Wang, J., Gao, R., and Xie, Y. (2021). +\newblock Sinkhorn distributionally robust optimization. +\newblock {\em arXiv preprint arXiv:2109.11926}. + +\bibitem[Wibisono, 2025]{wibisono2025mixing} +Wibisono, A. (2025). +\newblock Mixing time of the proximal sampler in relative fisher information via strong data processing inequality. +\newblock {\em arXiv preprint arXiv:2502.05623}. + +\bibitem[Xu et~al., 2024]{xu2024flow} +Xu, C., Lee, J., Cheng, X., and Xie, Y. (2024). +\newblock Flow-based distributionally robust optimization. +\newblock {\em IEEE Journal on Selected Areas in Information Theory}, 5:62--77. + +\bibitem[Yu et~al., 2022]{yuFastDistributionallyRobust2022} +Yu, Y., Lin, T., Mazumdar, E.~V., and Jordan, M. (2022). +\newblock Fast {{Distributionally Robust Learning}} with {{Variance-Reduced Min-Max Optimization}}. +\newblock In {\em Proceedings of {{The}} 25th {{International Conference}} on {{Artificial Intelligence}} and {{Statistics}}}, pages 1219--1250. PMLR. + +\bibitem[Zhao and Guan, 2018]{zhaoDatadrivenRiskaverseStochastic2018} +Zhao, C. and Guan, Y. (2018). +\newblock Data-driven risk-averse stochastic optimization with {{Wasserstein}} metric. +\newblock {\em Operations Research Letters}, 46(2):262--267. + +\bibitem[Zhu et~al., 2021]{zhu2021kernel} +Zhu, J.-J., Jitkrittum, W., Diehl, M., and Sch{\"o}lkopf, B. (2021). +\newblock Kernel distributionally robust optimization: Generalized duality theorem and stochastic approximation. +\newblock In {\em International Conference on Artificial Intelligence and Statistics}, pages 280--288. PMLR. + +\bibitem[Zhu and Xie, 2024]{zhu2024distributionally} +Zhu, L. and Xie, Y. (2024). +\newblock Distributionally robust optimization via iterative algorithms in continuous probability spaces. +\newblock {\em arXiv preprint arXiv:2412.20556}. + +\end{thebibliography} diff --git a/source_v1/main.tex b/source_v1/main.tex new file mode 100644 index 0000000000000000000000000000000000000000..8d26a6f6c21f588d65510dcd62424fb428135e67 --- /dev/null +++ b/source_v1/main.tex @@ -0,0 +1,1422 @@ +\documentclass{article} + + +\usepackage{arxiv} + +\usepackage[english]{babel} +\usepackage[utf8]{inputenc} % +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{float} +\usepackage{booktabs} % +\usepackage{multirow} % +\usepackage{graphicx} +\usepackage{subcaption} +\usepackage[colorinlistoftodos]{todonotes} +\usepackage[authoryear]{natbib} +\usepackage{algorithm} +\usepackage{algpseudocode} +\usepackage{pgfplots} +\pgfplotsset{compat=1.12} +\usepackage{hyperref} % + + +\newcommand{\Qrob}{\mathbb{Q}} +\newcommand{\calP}{\mathcal{P}} +\newcommand{\calM}{\mathcal{M}} +\newcommand{\calZ}{\mathcal{Z}} +\newcommand{\calB}{\mathcal{B}} +\newcommand{\W}{\mathbb{W}} +\newcommand{\X}{\mathcal{X}} +\newcommand{\calK}{\mathcal{K}} +\newcommand{\esssup}{\operatornamewithlimits{ess\,sup}} +\newcommand{\norm}[1]{\left\lVert#1\right\rVert} + +\newtheorem{theorem}{Theorem} +\newtheorem{lemma}{Lemma} +\newtheorem{Proposition}{Proposition} +\newtheorem{corollary}{Corollary} +\newtheorem{definition}{Definition} +\newtheorem{assumption}{Assumption} +\newtheorem{condition}{Condition} +\newtheorem{remark}{Remark} +\newenvironment{proof}{\paragraph{Proof:}}{\hfill$\square$} + + + + +\usepackage{preamble-JZ} + +\title{Gradient Flow Sampler-based\\ +Distributionally Robust Optimization} + +\author{ +Zusen Xu\\ +Weierstrass Institute for \\ +Applied Analysis and Stochastics\\ +Berlin, Germany\\ +\texttt{zusen.xu@wias-berlin.de} \\ + \And +Jia-Jie Zhu\\ +Weierstrass Institute for \\ +Applied Analysis and Stochastics\\ +Berlin, Germany\\ +\texttt{zplusj@gmail.com}\\ +} + +\begin{document} + +\maketitle + + + +\begin{abstract} +We propose a mathematically principled PDE gradient flow framework for distributionally robust optimization (DRO). Exploiting the recent advances in the intersection of Markov Chain Monte Carlo sampling and gradient flow theory, we show that our theoretical framework can be implemented as practical algorithms for sampling from worst-case distributions and, consequently, DRO. While numerous previous works have proposed various reformulation techniques and iterative algorithms, we contribute a sound gradient flow view of the distributional optimization that can be used to construct new algorithms. +As an example of applications, we solve a class of Wasserstein and Sinkhorn DRO problems using the recently-discovered Wasserstein Fisher-Rao and Stein variational gradient flows. Notably, we also show some simple reductions of our framework recover exactly previously proposed popular DRO methods, and provide new insights into their theoretical limit and optimization dynamics. Numerical studies based on stochastic gradient descent provide empirical backing for our theoretical findings. + +\end{abstract} + + + +\section{Introduction} +Distributionally robust optimization (DRO)~\citep{delageDistributionallyRobustOptimization2010,kuhnDistributionallyRobustOptimization2024} +is a framework that aims to enhance the robustness of the solution to optimization problems. +Since the original Wasserstein distributionally robust optimization (DRO) works by \citep{mohajerin2018data,zhaoDatadrivenRiskaverseStochastic2018,gaoDistributionallyRobustStochastic2016}, many subsequent works have presented variations of problems with various numerical solutions. +In particular, the entropy-regularized Wasserstein DRO problem can be formulated as the penalized optimization problem: +\begin{align} + \min_{\theta\in\Theta} \max_{\rho\in\calP} + \int \ell(\theta, z)\dd\rho{(z)} - \tfrac1{2\tau} W^2_{\epsilon}(\rho,\widehat{\rho_N}) + \label{eq:main-ent-dro} +\end{align} +where +$W_\epsilon$ is the +entropy-regularized optimal transport (OT) divergence to be defined later, +$\epsilon > 0$ is the entropy regularization parameter, and $\tau > 0$ is a temperature parameter (Lagrange multiplier); see later discussions. +This DRO problem was considered by \citep{wang2021sinkhorn}. +If we set $\epsilon = 0 $, we recover the penalized version of the Wasserstein DRO as considered by \citep{sinha2020certifyingdistributionalrobustnessprincipled}. +For the mathematical analysis, we will temporarily focus on the interesting choice of $W_\epsilon$, while other choices such as the KL divergences can also be adapted to our framework. +There is a thread of works that considered the (D)RO problems via the gradient descent-ascent dynamics, e.g., +\citep{wang2022exponentially,yuFastDistributionallyRobust2022,trillosAdversarialRobustnessUse2023,congerStrategicDistributionShift2023}. +For illustration, let $V:=-\ell(\theta, x)$ and $\rho_0=\widehat{\rho_N}$. +The inner maximization problem can be written in the form of a proximal problem +\begin{align} + \min_{\rho \in \calP} \; + \int V \, \dd \rho(x) + \tfrac{1}{2\tau} W^2_\epsilon(\rho, {\rho_0}) + \label{eq:proximal-EOT} +\end{align} +If we set $\epsilon = 0 $, we recover the +Wasserstein proximal problem, +commonly known as the Jordan-Kinderlehrer-Otto (JKO) scheme in the PDE literature, +which +can be viewed as one-step discretization of the continuous time PDE: +\begin{align} + \partial_t \rho = -\nabla \cdot \left( \nabla \rho \cdot \nabla V \right) + \label{eq:wasserstein-gradflow-pde} +\end{align} +In this paper, we shift the perspective and view the inner maximization problem as a regularized variational problem that corresponds to a sampling algorithm, without explicitly resorting to gradient ascent dynamics~\eqref{eq:wasserstein-gradflow-pde}. +This change not only simplifies the problem structure but also provides intuition for novel algorithmic design, which we use to effortlessly obtain novel algorithms such as Wasserstein-Fisher-Rao gradient and Stein variational based DRO algorithms. +\paragraph*{Contributions.} +Importantly, we distinguish between two different notions: +\begin{tightenum} +\item The DRO problem formulation with various ambiguity sets, e.g., Wasserstein DRO~\citep{zhaoDatadrivenRiskaverseStochastic2018,mohajerin2018data,gaoDistributionallyRobustStochastic2016}, KL-DRO~\citep{hu2013kullback,ben-talRobustSolutionsOptimization2013}, Sinkhorn DRO~\citep{wang2021sinkhorn}, Kernel DRO~\citep{zhu2021kernel}, etc. +\item The optimization algorithm and analysis for solving the DRO problem, e.g., WRM~\citep{sinha2020certifyingdistributionalrobustnessprincipled}, reformulation techniques~\citep{mohajerin2018data}, SGD~\citep{levyLargeScaleMethodsDistributionally2020}, etc. +\end{tightenum} +In this paper, We do not invent new DRO problem formulations or ambiguity sets (item 1 above). Instead, we propose a principled mathematical framework for analysis and novel algorithms for solving DRO (item 2 above), based on the theory of gradient flows and PDEs. +As a consequence of our theoretical insights, we have invented novel algorithms such as Stein variational gradient, Wasserstein-Fisher-Rao, rejection sampler-based algorithms, etc., for solving existing DRO problems with great generality and theoretical guarantees. +We provide code implementations of our algorithms in the online repository: \url{https://github.com/ZusenXu/GFS-DRO}. + +Furthermore, we see an elegant connection between DRO and variational methods (in the sense of calculus of variations) such as gradient flows and PDE analysis. +This connection allows us to directly apply theoretical results from those domains backed by rigorous mathematical machinery such as metric space gradient flows~\citep{ambrosio2008gradient}, without inventing a new theory or ad-hoc analysis techniques. +\vspace{-0.5cm} +\section{Preliminaries} +\subsection{Gradient Systems and Their Gradient Flow Equations} +The Wasserstein gradient flow (WGF) framework of \citep{otto1996double} was introduced into the sampling literature to provide a theoretical foundation; see +\citep{chewi2024statistical,garcia2018continuum} +for recent surveys. +In that framework, one can write a flow equation formally as +\begin{align} + \dot \rho = + - \mathbb G_W(\rho)^{-1}(\rho) \frac{\delta F}{\delta \rho}[ \rho] + = \nabla \cdot\left(\rho\nabla \frac{\delta F}{\delta \rho}[ \rho]\right) + \label{eq:wasserstein-gfe} +\end{align} +using +the inverse of the Wasserstein Riemannian metric tensor: +$\mathbb G_W^{-1}(\rho): T^*_\rho \calM \to T_\rho \calM, \xi \mapsto -\nabla \cdot(\rho\nabla \xi),$ +where $T_\rho \calM$ is the tangent space of $\Mplus$ at $\rho$ and +$T^*_\rho \calM$ the cotangent space. +With those ingredients, we can formally define the gradient systems that generate gradient flow equations such as the WGF equation~\eqref{eq:wasserstein-gfe}. +We refer to \citep{mielke2023introduction} for more details. +\begin{definition} + [Gradient system] + We refer to a tuple $\left( \calM, F, \bbG \right)$ + as a gradient system. + It has the gradient structure + identified by: +\begin{tightenum} + \item a space $\calM$, + \item an energy functional $F$, + \item a dissipation geometry given by either: + a distance metric defined on $\calM$ or + a Riemannian metric tensor $\mathbb G$. +\end{tightenum} +\label{def:gradient-system} +\end{definition} + +\subsection{Markov Chain Monte Carlo Sampler via Gradient Flow.} +For sampling and inference, +a common choice for the energy functional is the KL divergence, +i.e., +$F(\rho) = \KL(\rho | \pi)$. +Through elementary calculation, we obtain from \eqref{eq:wasserstein-gfe} the Fokker-Planck equation (FPE) +\begin{align} + \partial_t \rho = + \nabla \cdot \left( \rho \nabla \log\frac{\rho}{\pi} \right) + = + { \Delta \rho} - \nabla \cdot \left( \rho \nabla \log \pi \right) + . + \label{eq:fokker-planck} + \end{align} +When we express the target as $\pi(x) = \frac1Z \exp(-V(x))$ +where $Z$ is a normalization constant (partition function), \eqref{eq:fokker-planck} is then +$\partial_t \rho = { \Delta \rho} + \nabla \cdot \left( \rho \nabla V \right)$. +Viewed as a dynamic system, the KL divergence energy functional dissipates +along \eqref{eq:fokker-planck} in the steepest descent manner. +Based on Definition~\ref{def:gradient-system}, we say that PDE~\eqref{eq:fokker-planck} has the \emph{gradient structure} that entails the following key ingredients: +\begin{align} + \begin{cases} + \textrm{{Space} :}& + \text{prob. space } + \mathcal P , + \\ + \textrm{Energy functional} :& {F(\cdot):= \KL(\cdot | \pi)}, + \\ + \textrm{Dissipation Geometry} :& { \text{Wasserstein metric}}. + \end{cases} + \label{eq:gradient-structure-fkl-wgf} +\end{align} + + + + +\subsection{Entropy-regularized Wasserstein DRO.} +Works such as \citep{sinha2020certifyingdistributionalrobustnessprincipled,wang2021sinkhorn} considered DRO problems with rather general loss functions as they are based on general-purpose continuous optimization rather than DRO reformulation techniques for special losses. +A key result from \citep{wang2021sinkhorn} is the characterization of the worst-case distribution $\pi_Y$ that solves problem \eqref{eq:proximal-EOT}, referred to as Sinkhorn DRO therein. It has a closed-form density given by a mixture form: + $\pi_Y = \E_{x\sim\widehat{\rho_N}} \left[ \rho^*_{Y|X=x} \right]$, +where the conditional density is +\begin{align} + \rho^*_{Y|X=x} = \frac{1}{Z_x} \exp\left( -\tfrac{2\tau}\epsilon\widetilde V_{x, \tau} \right). + \label{eq:conditional-sampling-density} +\end{align} +for $\widetilde V_{x, \tau}(y):= V(y)+\tfrac1{2\tau}c(y, x)$, and $Z_x = \int\exp\left( -\tfrac{2\tau}\epsilon\widetilde V_{x, \tau}(y) \right) dy$ is a normalizing constant. + + +\citep{wang2021sinkhorn} proposed an algorithm based on solving the dual formulation of this DRO problem. +They developed a specialized two-level sampling procedure to estimate the gradient of the dual objective. +Different from their dual approach, this paper develops a unified gradient flow sampler framework that directly samples from the primal worst-case distribution that solves the inner problem. + + +\section{A Gradient Flow Framework for Sampling from Worst-case Distributions} + +\subsection{Schr\"odinger Bridge Formulation of DRO} +The variational problem \eqref{eq:proximal-EOT}, hence the inner maximization problem of DRO, +is a special case of the Schr\"odinger bridge with one free marginal, i.e., half bridge or one-sided bridge. +\begin{lemma}\label{lem:sb-klform} + The variational problem \eqref{eq:proximal-EOT} is + equivalent to the Schr\"odinger half bridge problem + \begin{align} + \min _{\Pi} + \biggl\{ + \int V \dd \Pi + \frac{1}{2\tau } + \int c(x,y) \dd\Pi + \frac\epsilon{2\tau}\int \log \Pi \dd\Pi + \, \, + \bigg | + \int \Pi \dd y = \rho_0 + \biggr\} + . + \end{align} + + Consequently, it is equivalent to the minimization of the expected KL divergence with respect to the conditional distribution + \begin{align}\label{eq:sb-klform} + \min_{\rho_{Y|X}} + \mathbb{E}_{x\sim\rho_0} + \KL + \left( + \rho_{Y|X=x}(y) + \bigg| + \dfrac{1}{Z_x} + \exp \left[ + - \dfrac{2\tau V(y) + c(y,x)}{\epsilon} + \right] + \right) + . + \end{align} + The optimal marginal distribution of $Y$ is given by a mixture distribution, for some normalization constant $Z_x$: + \begin{align}\label{eq:worst-dist} + \pi_Y \propto \E_{x\sim \rho_0} \left[ + \dfrac{1}{Z_x}\exp + \left[{-\frac{2\tau V(y) +c(y, x) }{\epsilon}} \right] + \right]. + \end{align} +\end{lemma} +This statement gives the overal variaional structure of the DRO problem such as +\eqref{eq:main-ent-dro}. +One may take the initial distribution $\rho_0$ as the empirical distribution $\widehat{\rho_N}$ for the data-driven DRO problem, +resulting in the following proposed gradient flow sampler-based algorithms. +\subsection{Gradient Flow Sampler-based DRO} +In variational problem~\eqref{eq:sb-klform}, +the KL divergence energy functional (without expectation) can also be written as: + \begin{align} + F(\rho) := + \frac{\epsilon}{2\tau} + \KL + \left( + \rho\ + \bigg| + \dfrac{1}{Z_x} + \exp \left[ + -\dfrac{2\tau V(y) + c(y,x)}{\epsilon} + \right] + \right) + = + \int V\, \dd \rho + + \frac{1}{2\tau} W_c^2(\rho, \delta_x) + + + \frac{\epsilon}{2\tau} \int \rho \log \rho + + \const + \label{eq:conditional-sampling-energy} + \end{align} + Note that the formulation on the right-hand side was also observed by \citep{chen2022improved} in studying the proximal sampler. + +With those ingredients, +in this paper, we propose to achieve +sampling from the conditional distribution $\rho_{Y\mid X}$ by simulating the \emph{gradient system +$\displaystyle\left( +\calP, F, \mathbb G +\right)$}. +This results in the formal gradient flow equation: +$$ +\dot\rho = - \mathbb G^{-1}(\rho)\, DF(\rho). +$$ +where we can freely choose the dissipation geometry $\mathbb G$ for the gradient flow. +Then, +our central methodology is the following perspective of sampling from conditional distributions +connected to the KL-minimization problem~\eqref{eq:sb-klform}. +Considering solving the inner maximization problem~\eqref{eq:main-ent-dro} via the following two-step sampling procedure: +\begin{algorithm}[h!] +\caption{Worst-case Distribution Sampler via Gradient Flows} +\label{alg:sampler} +\begin{algorithmic}[1] + \State \textbf{Input:} an initial distribution ${\rho}_0$ to sample from (e.g. empirical distribution $\widehat{\rho}_N$ in data-driven DRO) + \State Sample $X \sim {\rho}_0$ + \State Sample $Y \sim \rho_{Y\mid X}$ + using a gradient flow + (e.g. with energy functional given by \eqref{eq:conditional-sampling-energy}) + \State \textbf{Output:} sample $Y$ from the worst-case distribution +\end{algorithmic} +\end{algorithm} + + +Note that the choice of the dissipation geometry (e.g. Wasserstein) for this flow should not be confused with the entropy-regularized OT ambiguity set of the DRO problem formulation e.g. in \eqref{eq:main-ent-dro}. +Through gradient flow, our goal is to achieve the approximation +$\rho_\infty\approx \rho^*_{Y\mid X=x}$. + + + +Using the gradient flow sampler, we now propose the following general-purpose gradient flow sampler-based DRO framework. +\begin{algorithm}[h!] +\caption{Gradient Flow Sampler-based DRO} +\label{alg:GF-DRO} +\begin{algorithmic}[1] + \State \textbf{Input:} Initial distribution $\rho_0$, e.g., empirical distribution $\rho_0 = \widehat{\rho_N}$, constraint set $\Theta$, $\tau, \epsilon >0$, stepsize $\eta_t$ + \For{ iteration count $s = 0, \dots$} + \State Generate a sample from the worst-case distribution $y^s \sim \pi_Y$ by using the gradient flow sampler in Algorithm~\ref{alg:sampler} + \State DRO step: $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-\eta_s \nabla_\theta \ell(\theta^s, y^s))$ + \EndFor +\end{algorithmic} +\end{algorithm} +Other straigforward variants, such as using sample average approximation (SAA) instead of stochastic approximation (SA) above, are possible. +\subsubsection{Wasserstein Gradient Flow Sampler.} +As the first practial outcome of our theoretical insights, we instantiate a Wasserstein gradient flow (WGF) sampler for the entropy-regularized Wasserstein DRO (a.k.a. Sinkhorn DRO) problem using the update rule in \eqref{eq:ula-proximal-general-D-W2}. +\begin{example} + [Wasserstein GF for SDRO] + Our goal is to solve the entropy-regularized Wasserstein DRO (a.k.a. Sinkhorn DRO) problem in \eqref{eq:main-ent-dro}. + We consider the Wasserstein gradient system with the driving functional $J$ and the Wasserstein metric as the dissipation geometry: + $$\left( +\calP, F, W_2 +\right). +$$ + +In sampling algorithms, this gradient flow is typically +implemented by discretizing the Langevin SDE +$$ +dX_t = + \tfrac{2\tau}{\epsilon}\nabla\widetilde V_{x, \tau}(X_t) dt + dW_t, +$$ +resulting in the following forward Euler discretization known as the unadjusted Langevin algorithm (ULA). +Note that we use a scaled step size. +\begin{lemma} + The forward Euler discretization of the Wasserstein gradient flow equation of the energy functional $F$ in \eqref{eq:conditional-sampling-energy} is given by the difference equation at step $t$: + \begin{align} + X_{t+1} = X_t + \eta_t \nabla \widetilde V_{x, \tau}(X_t) + \sqrt{\eta_t\frac\epsilon\tau} \xi_t + \label{eq:ula-proximal-general-D-W2} + \end{align} + where $\xi_t$ is a standard normal random variable and + $\eta_t$ is the step size. +\end{lemma} +We note the step size scaling in front of the stochastic variable $\xi^{i,s}_t$ is different from the vanilla ULA update rule. +\end{example} +Adapting the above WGF radient flow dynamics to our GF-DRO framework in Algorithm~\ref{alg:GF-DRO}, we obtain the following discrete-time DRO algorithm summarized in Algorithm~\ref{alg:SDRO-NGD}. +\begin{algorithm}[h!] +\caption{Entropy-regularized Wasserstein DRO via WGF} +\label{alg:SDRO-NGD} +\begin{algorithmic}[1] + \State \textbf{Input:} Empirical distribution $\widehat{\rho_N}$, constraint set $\Theta$, $\tau, \epsilon >0$, stepsize sequence $\{r_s > 0\}_{s=0}^{S-1}$, inner stepsize $\eta$, inner iterations $T$, number of samples $m$. + \For{$s = 0, \dots, S-1$} + \State Sample $x^s \sim \widehat{\rho_N}$ + \State Initialize $y_{0}^{i,s} \leftarrow x^s, i=1,...,m$ + \For{$t = 0, \dots, T-1$} + \State Sample $\xi^{i,s}_t \sim\mathcal{N}(0,I)$ + \State Update sample using \eqref{eq:ula-proximal-general-D-W2}: $y_{t+1}^{i,s} = y_{t}^{i,s} + \eta\nabla\widetilde V_{x^s, \tau}(y_{t}^{i,s}) + \sqrt{\eta\epsilon/\tau} \xi^{i,s}_t$ + \EndFor + \State DRO step: $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-r_s \sum_{i=1}^m \frac{1}{m}\nabla_\theta \ell(\theta^{s},y_{T}^{i,s}))$ + \EndFor + \State \textbf{return} $\theta^S$ +\end{algorithmic} +\end{algorithm} +\begin{remark} + [\citep{sinha2020certifyingdistributionalrobustnessprincipled}'s WRM] + For the penalized Wasserstein DRO problem, + i.e. + $\epsilon=0$ in the entropy-regularized Wasserstein DRO problem, + the step in \eqref{eq:ula-proximal-general-D-W2} specializes to the update rule: + \begin{align} + X_{t+1} = X_t + \eta_t \nabla \widetilde V_{x, \tau}(X_t) + \label{eq:ula-proximal-general-D-W2-epsilon-0} + \end{align} + which coincides with the inner SGD step used in the WRM algorithm by \citep{sinha2020certifyingdistributionalrobustnessprincipled}. +Henece, their WRM algorithm is a special case (with only ODE) of our GF-DRO framework in Algorithm~\ref{alg:GF-DRO}. +\end{remark} +Through the example above, we see the value of this paper's gradient flow perspective: it can easily generalize the WRM algorithm~\citep{sinha2020certifyingdistributionalrobustnessprincipled} from ODE to a novel SDE-based algorithm for the Sinkhorn DRO problem using \eqref{eq:ula-proximal-general-D-W2}. +We see that the gradient flow perspective is not simply a theoretical formulation -- it lets us effortlessly design new algorithms to solve DRO without resorting ad-hoc modifications of other DRO methods. +Moreover, we will later go beyond the standard Wasserstein gradient flow and introduce more advanced gradient flows such as the Wasserstein Fisher-Rao (WFR) and Stein variational gradient (SVG) flows. + + + + + + + +\subsubsection{Wasserstein Fisher-Rao Flow Sampler.} +Consider the WFR gradient system of the energy functional $F$, i.e., the triple $\left( \calP, F, \WFR \right)$, where $\WFR$ is the Wasserstein-Fisher-Rao metric, a.k.a. the \emph{Hellinger-Kantorovich} metric restricted to the probability space\footnote{Note that there are many cases of misnomer in the machine learning literature: WFR should technically be defined over the space of positive measures, not the space of probability measures; see \citep{mielkeNotesHellingerDistance2025} for a historical account. The latter corresponds to the spherical Hellinger-Kantorovich metric. Although their gradient flow solutions can be easily related to each other via the mass scaling. See \citep{mielke2025hellinger} for technical details.}. +Specifically, we consider the HK/WFR gradient system associated with reaction-diffusion PDE: +\begin{align} + \frac{\partial \mu}{\partial t} + &= \alpha\, \mathrm{div} \left( \mu \nabla \frac{\delta F}{\delta \mu} \right) - \beta\, \mu + \left(\frac{\delta F}{\delta \mu} - \int \frac{\delta F}{\delta \mu}\dd \mu \right) + \label{eq:wfr-gradient-flow} +\end{align} +Discretizing the flow equation, +we propose a WFR worst-case distribution sampler-based SDRO in Algorithm \ref{alg:SDRO-WFR}. +The main intuition of this sampler, compared with the +WGF version, is the addition of the mass (weights) update of the particles. + +\begin{algorithm}[h!] +\caption{Entropy-regularized Wasserstein DRO via WFR flow} +\label{alg:SDRO-WFR} +\begin{algorithmic}[1] + \State \textbf{Input:} Empirical distribution $\widehat{\rho_N}$, constraint set $\Theta$, $\tau, \epsilon >0$, stepsize sequence $\{r_s > 0\}_{s=0}^{S-1}$, inner stepsize $\eta$, weight stepsize $\eta_w$, weight threshold $w_{\text{min}}$, inner iterations $T$, number of samples $m$. +\For{$s = 0, \dots, S-1$} + \State Sample $x^s \sim \widehat{\rho_N}$ + \State Initialize $y_{0}^{i,s} \leftarrow x^s, i=1,...,m$ + \For{$t = 0, \dots, T-1$} + \State Sample $\xi^{i,s}_t \sim\mathcal{N}(0,I)$ + \State $y_{t+1}^{i,s} = y_{t}^{i,s} + \eta\nabla\widetilde V_{x^s, \tau}(y_{t}^{i,s}) + \sqrt{\eta\epsilon/\tau} \xi^{i,s}_t$ + \State $w_{t+1}^{i,s} = (w_{t}^{i,s})^{1-\epsilon\eta_w/ (2\tau)}e^{\eta_w \widetilde V_{x^t, \tau}(y_{t}^{i,s})}$ + \State Normalize weights: $w_{t+1}^{i,s} = w_{t+1}^{i,s}/\sum_{j=1}^m w_{t+1}^{i,s}$ + + + \State Birth-death sampling: + \If {$w_{t+1}^{i,s} < w_{\text{min}}$} + \State Select $i'$ from $\{1, \dots, m\}$ with probability $w_{t+1}^{i',s}$. + \State $y_{t+1}^{i,s} = y_{t+1}^{i',s}$, $w_{t+1}^{i,s}= (w_{t+1}^{i,s} + w_{t+1}^{i',s})/2$, $w_{t+1}^{i',s} = w_{t+1}^{i,s}$. + \EndIf + \EndFor + \State DRO step: $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-r_s \sum_{i=1}^m w_{T}^{i,s}\nabla_\theta \ell(\theta^{s},y_{T}^{i,s}))$ + \EndFor + \State \textbf{return} $\theta^S$ + + + +\end{algorithmic} +\end{algorithm} + +\subsubsection{Stein Variational Gradient Flow Sampler.} +In an attempt to simulate the \eqref{eq:fokker-planck} using deterministic particle-based methods instead of SDEs, +\citep{liu2016stein} +proposed the Stein variational gradient descent (SVGD) algorithm, which is a +implementable +discrete-time algorithmic version of \eqref{eq:fokker-planck}. +At time step $t$, +it updates the particle locations via the following gradient descent scheme. + $$X^i_{t+1} =X^i_t - + \eta\cdot + \big( + \frac{1}{m}\sum_{j=1}^m + \nabla V(X^j_t)k(X^j_t,X^i_t ) + + + \frac{1}{m}\sum_{j=1}^m\nabla_2 k(X^j_t,X^i_t ) + \big) + . + $$ +Here, $X^i_t$ represents the position of the $i$-th particle at time step $t$, $\eta$ is the step size, $m$ is the total number of particles. +$k(\cdot,\cdot)$ is a positive definite kernel function, and $\nabla_2$ denotes the gradient with respect to the second argument of the kernel. +Different from the typical implementation such as ULA, SVGD offers a deterministic algorithm for sampling with the kernel $k$ modeling the pairwise interaction between particles. +Applying SVGD to the inner problem of DRO, we propose Algorithm~\ref{alg:SDRO-SVG}. See a detailed analysis in Section~\ref{sec:svg}. + + +\subsubsection{Rejection Sampler.} +We also propose Algorithm~\ref{alg:SDRO_rgo} based on rejection sampler (RGO). This approach is based on the backward step of the proximal sampler \citep{lee2021structured,chen2022improved,wibisono2025mixing}, as detailed in Section~\ref{sec:rgo}. However, this method requires the loss function to be $L$-smooth and cannot be applied when $\tau$ is relatively large, a limitation we will demonstrate in later experiments. + +\section{Analysis of Gradient Flows} +For algorithmic design, one paradigm is to first obtain intuition and insights from principled mathematical analysis before constructing practical numerical algorithms. +While the development in machine learning research does not always follow this pattern, we argue in this paper that, by first understanding the theoretical limits of the gradient flow, we can design novel DRO algorithms that performs as expected theoretically. This is done without inventing new theoretical framework, but by leveraging the existing gradient flow and PDE analysis specialized to the problem. +The discrete-time algorithmic analysis will follow in a later section. + + + +In DRO works such as \citep{sinha2020certifyingdistributionalrobustnessprincipled} +and subsequent variants, +complexity analysis typically involves controlling the gradient estimation error. +That is, to control +the deviation +from the true gradient used for DRO. +For illustration, let us consider the +DRO problem \eqref{eq:main-ent-dro}. +Note that +setting $\epsilon = 0$ recovers the +problem of \citep{sinha2020certifyingdistributionalrobustnessprincipled}. +One needs to estimate the gradient w.r.t. $\theta$ for the outer DRO problem, i.e., estimating +\begin{align} +\label{eq:grad-estimate} +\widehat g \approx +\nabla_\theta +\max _{\rho \in \calP} +\biggl( + \int \ell(\theta, z)\dd\rho{(z)} + -\frac1{2\tau} W_\epsilon^2(\rho, \widehat{\rho_N}) +\biggr) +\end{align} +and subsequently, the gradient estimate is used for the outer DRO problem via SGD-like updates, e.g., $\theta^{s+1} \gets \theta^s - \eta \widehat g$. +The bound of $\widehat g$ deviating from the true gradient can be used in the downstream standard optimization error bound for DRO solution. + + +With our gradient flow sampler-based DRO algorithm, +we aim to generate samples from the worst-case distribution $\pi_Y$, which is the entropic JKO solution +\begin{align} +\label{eq:entropic-jko} +\pi_{Y} \in \argmin_{\rho\in \calP} +\int V \, d\rho ++ \frac{1}{2\tau} W^2_{\epsilon}(\rho, \rho_0) +. +\end{align} +Following the framework of Algorithm~\ref{alg:sampler}, +for each $x_i\sim \rho_0$, +we generate samples from the worst-case distribution +by sampling from the conditional distribution, $y_i\sim \rho^*_{Y|X=x_i}$. +Then, for the outer DRO problem, we can use the sample-based gradient estimate $\widehat g = \tfrac1N \sum_{i=1}^N \nabla_\theta \ell(\theta, y_i)$ to update the parameter $\theta$. +The following result uses gradient flow analysis to bound the gradient estimate error. +We note that the result are stated in terms of the ideal continuous-time gradient flow, which is not the mixing time of the discrete-time sampler; we will detail the discrete-time algorithmic analysis in a later section. +The gradient flow analysis provides a key insight and guideline for the design of the gradient flow sampler-based DRO algorithm. + + + +For notational simplicity, we abbreviate $\widetilde V_{x,\tau}$ as $\widetilde V$ in this section and, specifically, for the case of quadratic transport cost $c(y,x) = \|x-y\|^2$, we define the following. +\begin{definition} +\label{as:gf-properties} +\begin{enumerate} + \item \textbf{Semi-convexity:} + \begin{align} + \nabla ^2 \widetilde V \geq \lambda I + \iff + \nabla ^2 V + \frac1{2\tau }I \geq \lambda I + \label{eq:semi-convexity} + \end{align} + \item \textbf{Gradient dominance/PL:} + There exists a constant $\lambda_{\text{PL}} > 0$ such that + \begin{align} + \big|\nabla \widetilde V \big|^2 \geq \lambda_{\text{PL}} \widetilde V, + \quad \forall x \in \mathcal X + \label{eq:gradient-dominance-PL} + \end{align} + \item \textbf{Generalized PL for functionals of measures along GF}: + \begin{align} + \frac{\dd}{\dd t} F(\rho_t) \geq \lambda_{\text{PL}} F(\rho_t), + \label{eq:generalized-PL} + \end{align} +\end{enumerate} +\end{definition} + +It is immediate that +$$ +\text{semi-convexity with } \lambda >0 \text{ (strong convexity)} + \implies + \text{gradient dominance/PL} + \implies + \text{generalized PL of }F + . +$$ +We note that +the first condition in Definition~\ref{as:gf-properties} +does not require the function $V$ to be convex. Hence, the DRO loss $\ell(\theta, x)$ does not necessarily need to be concave in variable $x$. +In such cases, we can already obtain the geodesic convexity of $F$ in the Wasserstein space, termed displacement convexity. + +Using standard analysis of gradient flow, we obtain the following ideal estimate +\begin{proposition}\label{prop:gradient_oracle_error_control} + Denote the initial sample $x^i\sim \widehat{\rho_N}$ and samples running the gradient flow sampler for time $t$ are $y^i_t\sim \rho^*_{Y|X=x^i}$. + Suppose that the loss function $\ell(\theta, x)$ + is $L$-smooth in $x$ and + $\widetilde V_{x, \tau}(y) : = -\ell(\theta, y)+\tfrac1{2\tau}c(y, x)$ satisfies the gradient dominance condition in Definition~\ref{as:gf-properties} with $\lambda > 0$. + Then, in order to generate an $\epsilon$-gradient estimate, i.e., + \begin{align*} + \bigg|\frac1N \sum_{i=1}^N \nabla_\theta \ell(\theta, y^i_t) + - + \nabla_\theta + \underbrace{ + \max _{\rho \in \calP} + \biggl( + \int \ell(\theta, z)\dd\rho{(z)} + -\frac1{2\tau} W_\epsilon^2(\rho, \widehat{\rho_N}) + \biggr) + }_{\text{DRO objective}} + \bigg| + {\leq} + \epsilon, + \end{align*} + the Wasserstein gradient flow sampler needs to run for time at least\; + $\displaystyle t \gtrsim \calO \left(\frac{1}{\lambda}\log{\frac{L}{\sqrt{\lambda}\epsilon}}\right)$. +\end{proposition} + + +Results such as Proposition~\ref{prop:gradient_oracle_error_control} are based on the displacement convexity or PL in the Wasserstein space. +The value of our general gradient flow perspective is to let us freely choose the gradient flow geometry, not confined to Wasserstein. +This is not just for theoretical considerations --- the estimate such as +\eqref{eq:gf_time_to_epsilon} +depends crucially on the (PL/convexity) constant $\lambda$, which has been a major limitation of the Langevin type samplers in the literature. +Note that the speed-up is due to +an advantage of the Hellinger or Fisher-Rao geometry when the warm-start initialization is given. +It provides a simple insight for algorithmic design: the unbalanced WFR gradient flow can be used to speed up the sampling process for DRO. +This insight is later validated in the numerical studies. + + +As noted earlier, Proposition~\ref{prop:gradient_oracle_error_control} +is aimed at providing the intuition for the behavior of the gradient flow sampler-based DRO algorithm; it is not the practical complexity estimate based on sampler's mixing time. +As it's based on standard theory of gradient flow, it serves as a guideline for the design of the gradient flow sampler-based DRO algorithm using existing tools from PDE/SDE. +Next, we provide optimization complexity estimate which characterizes the practical sampler-based DRO algorithm. + + + + + +\section{Optimization Complexity Analysis} +For notational convenience, we define: +$\Phi(\theta): = \max_{\rho\in\calP} + \int \ell(\theta, z)\dd\rho{(z)} - \tfrac1{2\tau} W^2_{\epsilon}(\rho,\widehat{\rho_N})$. +Then, the DRO problem \eqref{eq:main-ent-dro} can be written succinctly as +$\min_{\theta\in\Theta} \Phi(\theta)$. +We analyze the computational complexity of our proposed discrete-time algorithms, aiming to find an $\epsilon_{\text{opt}}$-stationary point $\theta^{S}$ at the last iteration $S$, +i.e. $\mathbb{E}[\|\nabla\Phi(\theta^{S})\|^{2}]\le\epsilon_{\text{opt}}^{2}$. + +Our analysis uses a standard framework for non-convex stochastic optimization \citep{ghadimi2013stochastic}. The outer loop performs SGD on $\theta$, while the inner loop generates samples to approximate the conditional worst-case distribution. The key challenge is controlling the bias in the stochastic gradient. +For technical reasons, we make the following assumptions. + +\begin{assumption}\label{as:totalsmooth} +$\Phi(\theta)$ is $L_{\Phi}$-smooth. +\end{assumption} + +\begin{assumption}\label{as:fsmooth} + The gradient of the loss function $\ell(\theta, z)$ in \eqref{eq:main-ent-dro}, $\nabla_{\theta}\ell(\theta, z)$ is $L_{f}$-Lipschitz with respect to $z$. +\end{assumption} +\begin{assumption}\label{as:gradest} +The stochastic gradient estimator $\widehat g:= \E_{\widehat\rho_{Y|X=x}} [\nabla_{\theta}\ell(\theta, y)]$ has bounded variance $\sigma^2$. The inner-loop sampler (Algorithm~\ref{alg:sampler}) generates a distribution $\widehat\rho_{Y|X=x}$ with a uniformly bounded expected error $\E_{x \sim \widehat{\rho_N}}[W_2(\widehat\rho_{Y|X=x}, \rho^*_{Y|X=x})] \le \delta_{\text{sample}}$. +\end{assumption} + +Under these assumptions, we can bound the gradient bias and establish a general convergence result for the outer loop. + +\begin{theorem}[Outer Loop Convergence] +\label{thm:outer_loop} +Let Assumptions \ref{as:totalsmooth}, \ref{as:fsmooth}, \ref{as:gradest} hold. With a constant step size $r = O(1/L_\Phi)$, the outer loop requires $S = O(1/\epsilon_{\text{opt}}^2)$ iterations to find an $\epsilon_{\text{opt}}$-stationary point, provided the error $\delta_{\text{sample}}$ in Assumption~\ref{as:gradest} is controlled such that $\delta_{\text{sample}} = O(\epsilon_{\text{opt}}/L_f)$. +\end{theorem} + +For the analysis of the ULA-based sampler (Algorithm \ref{alg:SDRO-NGD}), we introduce the following assumption on the geometry of the inner target distribution. + +\begin{assumption}\label{as:LSI} +For any fixed $\theta$ and $x$, the conditional distribution $\rho_{Y|X=x}$ is $L_{U}$-smooth and satisfies the $\alpha_U$-log-Sobolev inequality (LSI). +\end{assumption} + +Assumption \ref{as:LSI} is motivated by the convergence analysis of ULA \citep{vempala2019rapid, wibisono2025mixing}, which often requires the target distribution to satisfy the $\alpha$-log-Sobolev inequality ($\alpha$-LSI) \citep{gross1975logarithmic}. We recall that a distribution $\rho$ satisfies the $\alpha$-LSI for some $\alpha>0$ if, for any probability distribution $\nu$, the following inequality holds: +\[ +\text{FI}(\nu \| \rho) \ge 2\alpha \KL(\nu \| \rho), +\] +where $\KL(\nu \| \rho) := \E_\nu\left[\log\frac{\nu}{\rho}\right]$ is the KL divergence and $\text{FI}(\nu \| \rho) := \E_\nu\left[\left\|\nabla\log\frac{\nu}{\rho}\right\|^2\right]$ is the relative Fisher information. Since the relative Fisher information is the squared gradient norm of the KL divergence in the $W_2$ metric, the property that $\rho$ satisfies LSI is equivalent to the Polyak-Łojaciewicz (PL) or gradient domination property of the KL divergence objective function. + + +It is important to clarify, however, that the PL inequality for the potential function $\widetilde{V}_{x,\tau}$ itself (as in \eqref{eq:gradient-dominance-PL}) is not equivalent to the LSI for the distribution $\rho_{Y|X=x}=\exp\left(-\frac{2\tau}{\epsilon}\widetilde{V}_{x,\tau}\right)$. + +Assumption~\ref{as:LSI} allows us to bound the number of inner ULA iterations required to achieve the necessary sampling accuracy. Combining these results yields the total complexity. + +\begin{theorem}[Complexity of Algorithm \ref{alg:SDRO-NGD}]\label{thm:ula} +Under Assumptions \ref{as:totalsmooth}, \ref{as:fsmooth}, \ref{as:gradest}, and \ref{as:LSI}, the total complexity for Algorithm 3 to find an $\epsilon_{\text{opt}}$-stationary point is: +\begin{align*} +\text{Complexity} = O\left(\frac{L_{\Phi} L_U^2 L_f^2 d^2}{\alpha_U^3 \epsilon_{\text{opt}}^4}\cdot\log \frac{1}{\epsilon_{\text{opt}}}\right) = \tilde{O}\left(\frac{L_{\Phi} L_U^2 L_f^2 d^2}{\alpha_U^3 \epsilon_{\text{opt}}^4}\right). +\end{align*} +\end{theorem} +The detailed derivations for the gradient bias, the proof of Theorem \ref{thm:outer_loop}, and the complexity analysis are provided in Appendix~\ref{ap:complexity_proofs}. + + + + + + + + + + + + + + + + + + + +\section{Experiments} + +We conduct numerical experiments on different tasks to validate our theoretical insights. Our goal is to compare the performance of four different DRO methods-Algorithm~\ref{alg:SDRO-WFR} (WFR) and Algorithm~\ref{alg:SDRO-NGD} (WGF), the dual method for SDRO (Dual)\citep{wang2021sinkhorn}, and WRM \citep{sinha2020certifyingdistributionalrobustnessprincipled}. We also compare Stein Variational Gradient (SVG) (Algorithm~\ref{alg:SDRO-SVG}) method and Restricted Gaussian Oracle (RGO) (Algorithm~\ref{alg:SDRO_rgo}) method with these methods in Section~\ref{sec:experiment3} and Section~\ref{sec:experiment4}. For methodological consistency across all experiments, the Dual method uses Randomized Truncation MLMC\citep{blanchet2015unbiased} as suggested in \citep{wang2021sinkhorn}, and the WRM solves its inner problem using gradient descent. +All experiments were conducted on a laptop with an NVIDIA RTX A3000 GPU using Python. The code is available at https://github.com/ZusenXu/GFS-DRO + +\subsection{Classification under Data Imbalance}\label{sec:circle-exp} + +\begin{figure*}[h!] +\begin{subfigure}[b]{0.32\textwidth} + \includegraphics[width=\textwidth]{circle_boundary_comparison.pdf} + \caption{Decision boundaries} + \label{fig:circle-boundary} + \end{subfigure} + \hfill + \begin{subfigure}[b]{0.32\textwidth} + \includegraphics[width=\textwidth]{WFR_frame_000_samples.pdf} + \caption{Perturbation by WFR} + \label{fig:WFR_circle} + \end{subfigure} + \hfill + \begin{subfigure}[b]{0.32\textwidth} + \includegraphics[width=\textwidth]{WRM_frame_000_samples.pdf} + \caption{Perturbation by WRM} + \label{fig:WRM_circle} + \end{subfigure} + \caption{\textbf{Robust Decision Boundaries with Biased Data.} \textbf{(a)} Decision boundaries learned by different methods on the biased circle dataset. The training data are shown as orange (positive class) and blue (negative class) points. The final classification boundaries are shown for the WRM (green), WGF (purple), WFR (red), and Dual (brown) models. All models were trained for 40 epochs. We set the regularization parameter $\tau=2.5$ for all methods and the entropy regularization $\epsilon=0.15$ for methods based on entropy-regularized Wasserstein DRO problem. \textbf{(b)} Samples from the worst-case distribution generated by WFR sampler at the first epoch. + \textbf{(c)} Worst-case samples generated by WRM method at the first epoch. WRM can only generate discrete distributions as worst-case distribution while Sinkhorn DRO uses potentially continuous distributions as worst-case distribution. The original data points are shown as circles and the worst-case samples are shown by circles with a shallower color.} + \label{fig:circle-experiment} +\end{figure*} +This experiment demonstrates the robustness of our proposed methods to data imbalance. The experimental setup is adapted from \citep{sinha2020certifyingdistributionalrobustnessprincipled}. We generate a dataset where features $X \in \mathbb{R}^2$ are drawn from a Gaussian distribution. The labels are assigned based on the rule $Y = \text{sign}(\|X\|_2 - \sqrt{2})$, which creates two classes separated by a circle of radius $\sqrt{2}$. To establish a clear margin, all data points satisfying $\|X\|_2 \in (\sqrt{2}/1.3, 1.3\sqrt{2})$ are excluded. To simulate a biased training distribution, we remove all samples from the first quadrant. This removal introduces a significant imbalance, testing the ability of each algorithm to learn a generalizable decision boundary rather than overfitting to the biased training data. The model is a neural network with a single hidden layer of 4 units. + + + +Figure~\ref{fig:circle-boundary} visualizes the learned decision boundaries. WFR learns a decision boundary that closely matches the true circular boundary, correctly classifying the held-out data in the first quadrant and thus demonstrating robustness to the distributional shift. In contrast, the WRM boundary is overly expansive, misclassifying large regions of the feature space. This indicates a failure to generalize from the biased training set, resulting in a less reliable classifier. The boundary from WGF lies between those of WFR and WRM, highlighting the benefit of the weight flow mechanism in WFR for achieving a more robust solution. The dual method \citep{wang2021sinkhorn} does not perform as well as WFR in this setting. We attribute this to the high sensitivity of the dual method to the choice of hyperparameters ($\epsilon$ and $\lambda$), which can significantly impact the bias of the gradient estimator. + + +To further investigate the differing behaviors, Figure~\ref{fig:WFR_circle} and Figure~\ref{fig:WRM_circle} visualize the samples generated by WFR and WRM at the first epoch. We observe that the samples generated by WFR algorithm begin to recover parts of the missing data distribution in the first quadrant. Conversely, the samples generated by WRM fail to do so, providing insights into why it learns a less robust boundary. + + +\subsection{Two Moon Classification}\label{sec:experiment3} +In this section, we address a binary classification problem using the 'two moons' dataset. The model is a three-layer neural network with ReLU activations and a hidden dimension of 16. The objective is to minimize the cross-entropy loss. The cost function for samples $(x, y)$ and $(x', y')$ is defined as $c((x,y),(x',y'))=\|x-x'\|_2^2 + \infty \cdot \mathbf{1}_{y\neq y'}$. + +The training data is generated using \texttt{sklearn.make\_moons} with a noise level of 0.1. To introduce class imbalance, the training set of $N_{\text{train}}=200$ samples consists of 90\% positive ($y=1$) and 10\% negative ($y=0$) samples. + +\begin{figure}[h!] + \centering + \includegraphics[scale=0.7]{boundary_5_0.01.pdf} + \caption{Decision boundary comparison for all methods on the two-moon classification task. For all DRO methods, we set $\tau=0.1$, and for SDRO methods, we set $\epsilon=0.01$. In each inner loop, WFR and WGF generate $m=5$ particles.} + \label{fig:final_boundaries} +\end{figure} + + +Figure~\ref{fig:final_boundaries} illustrates the decision boundaries learned by various algorithms against the ideal boundary. Notably, the boundary from the WRM method fails to correctly separate the training data. The Dual method, while separating the classes in high-density regions, learns a boundary that deviates significantly from the ground truth. In contrast, WFR, and WGF learn boundaries that more closely approximate the ideal curve. Among them, WFR and WGF achieve the best results, tracking the ideal separator with high fidelity, which indicates superior performance in this setting. + + +To evaluate the capacity of generating the worst-case distribution of WRM, WGF, WFR, SVG, and RGO, we conducted an experiment on a pre-trained SAA model. This setup isolates the inner-loop optimization process used to find the worst-case distribution. The evolution of the inner objective function, $\mathbb{E}[\widetilde V_{x, \tau}(z)]$, is depicted in Figure~\ref{fig:loss_twomoon}. + + +The efficacy of WGF, WFR, and SVG in approximating the worst-case distribution is demonstrated by a significant increase in the objective value. The reweighting mechanism in WFR contributes to its faster convergence compared to WGF. In contrast, SVG's performance is highly dependent on its initialization parameters. An initial standard deviation of 0.1 leads to slower convergence than a standard deviation of 0.2, which achieves a rate similar to WFR. This sensitivity is attributed to the ability of a larger initial standard deviation to propel particles across the decision boundary, thereby facilitating a more thorough exploration of the perturbation space, as illustrated later in Figure~\ref{fig:perturbation_samples}. In contrast, WGF and WFR initiate their optimization from the empirical data distribution, which obviates the need to select initialization parameters. +\begin{figure}[h!] +\centering + \includegraphics[scale=0.6]{saa_perturb_objective_comparison.pdf} + \caption{Evolution of $\mathbb{E}[\widetilde V_{x, \tau}(z)]$. We run all methods for 300 steps with a stepsize of 0.01. For RGO (blue), we run a rejection sampling procedure after solving the inner optimization problem. SVG\_0.1 and SVG\_0.2 denote initial distributions with a standard deviation of 0.1 and 0.2, respectively.} + \label{fig:loss_twomoon} +\end{figure} + +\begin{figure*}[h!] +\centering + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{wrm_frame.pdf} + \caption{Perturbation by WRM} + \label{fig:wrm_perturb} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{rgo_frame.pdf} + \caption{Perturbation by RGO} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{wgf_frame.pdf} + \caption{Perturbation by WGF} + \label{fig:wgf_perturb} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{wfr_frame.pdf} + \caption{Perturbation by WFR} + \label{fig:wfr_perturb} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{svg_frame_0.1.pdf} + \caption{Perturbation by SVG ($\sigma=0.1$)} + \label{fig:svg0.1} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{svg_frame_0.2.pdf} + \caption{Perturbation by SVG ($\sigma=0.2$)} + \label{fig:svg0.2} + \end{subfigure} + \caption{Visualization of perturbed samples (gray-edged smaller circles) generated from original data (black-edged bigger circles) against the SAA boundary at the final step. For all methods, we use a stepsize of 0.01 and run for 300 iterations. For WFR, the intensity of points visualizes the sample weights. We show perturbations by SVG-DRO with different initializations.} + \label{fig:perturbation_samples} +\end{figure*} + +Conversely, WRM and RGO fail to significantly increase the objective. The non-convex nature of the objective, evidenced by the initial dip and subsequent rise for WGF and WFR, likely presents a challenge for the optimization procedures in WRM and RGO. Additionally, the performance of RGO is hindered by its rejection sampling stage, which is inefficient for non-smooth objectives. + + + +Figure~\ref{fig:perturbation_samples} provides a visual confirmation of these results, displaying the perturbed samples at the final iteration of the inner loop. WRM generates minimal perturbations, with particles remaining in close proximity to the original data points. The perturbations from RGO are qualitatively similar, appearing as slightly noisier versions of the WRM results. In contrast, WGF, WFR, and SVG generate a diverse set of adversarial examples, effectively pushing samples across the decision boundary, including those initially distant from it. Notably, the extent of perturbation for SVG is dependent on the initialization; an initial standard deviation of 0.2 results in more significant perturbations than a standard deviation of 0.1. And the particles generated by SVG for a single data point tend to be highly concentrated. + +This phenomenon arises from the interplay between the two forces governing SVGD: a driving force that pushes particles toward regions of higher loss and a repulsive force from the kernel that prevents particle collapse. The optimization dynamics, visualized in Figure~\ref{fig:svg_force}, show that the driving force initially dominates, causing the particles to converge. As the particles draw closer, the repulsive force increases to counteract this convergence. However, since the number of particles is relatively small, the repulsive force only dominates when particles are very close, leading to the observed particle concentration. This result also explains the reason why SVG shows nearly identical performance as WRM in Section~\ref{sec:experiment4}. + +\begin{figure*}[h!] +\centering + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{frame_020.pdf} + \caption{Iteration 20} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{frame_100.pdf} + \caption{Iteration 100} + \end{subfigure} + \hfill + \begin{subfigure}{0.32\textwidth} + \includegraphics[width=\textwidth]{frame_288.pdf} + \caption{Iteration 300} + \end{subfigure} + \caption{Evolution of particle positions in the SVG method. The driving force guides initial convergence, while the repulsive force prevents complete collapse. But in this experiment, the repulsive force fails to push particles apart efficiently, leading to the mode collapse. } + \label{fig:svg_force} +\end{figure*} + + + + +\subsection{Adversarial Multi-class Logistic Regression}\label{sec:experiment4} + +We evaluate the adversarial robustness of the algorithms on the features extracted from the real-world image dataset CIFAR-10 \citep{krizhevsky2009learning}. The task is multi-class logistic regression, minimizing the negative log-likelihood loss: +$$ +h_B(x,y) = -y^T B^T x + \log(\mathbf{1}^T e^{B^T x}) +$$ +where $B := [w_1, \dots, w_C]$ are the classifier parameters. We solve the DRO problem assuming perturbations affect features $x$ but not labels $y$. The CIFAR-10 images are processed using a ResNet-50 network pre-trained on ImageNet to extract 512-dimensional features. To evaluate robustness, we apply a Projected Gradient Descent (PGD) attack with $l_2$-norm constraints to the test data. The perturbation magnitude, $\Delta$, is normalized by the average $l_2$-norm of the test features, and we vary $\Delta$ from 0 to 0.08. Performance is measured by the misclassification rate. + +\begin{figure*}[h!] +\centering +\begin{subfigure}{0.3\textwidth} + \includegraphics[width=\textwidth]{rgo_lam=10_eps=0.2.pdf} + \caption{$\tau=0.05, \epsilon=0.2$} +\end{subfigure} +\hfill +\begin{subfigure}{0.3\textwidth} + \includegraphics[width=\textwidth]{rgo_lam=10_eps=0.02.pdf} + \caption{$\tau=0.05, \epsilon=0.02$} +\end{subfigure} +\hfill +\begin{subfigure}{0.3\textwidth} + \includegraphics[width=\textwidth]{rgo_lam=10_eps=0.002.pdf} + \caption{$\tau=0.05, \epsilon=0.002$} +\end{subfigure} +\caption{Experiment results of adversarial training on CIFAR-10 features under an $l_2$-norm PGD attack. The plots show the test error (\%) as a function of the normalized perturbation level $\Delta$ for different $\epsilon$. All models are trained for 10 epochs, and for all methods contain an inner loop, they employ a stepsize of 0.01, and run for 100 loops. } +\label{fig:robustness} +\end{figure*} +Figure~\ref{fig:robustness} presents the classification results under adversarial attack. Notably, RGO performs almost identically to the SAA baseline, failing to provide robustness in this task. This poor performance might be attributed to the failure of its rejection sampling mechanism due to the non-smooth loss function setting. In contrast, all other DRO methods demonstrate enhanced robustness. WFR and WGF, in particular, consistently achieve a high degree of robustness across all settings. The performance of the dual method proves sensitive to the choice of $\epsilon$; it performs comparably to WFR and WGF for larger values such as $\epsilon=0.2$, but its robustness degrades as $\epsilon$ decreases, with its error rate approaching that of the SAA baseline when $\epsilon=0.002$. Furthermore, SVG consistently shows nearly the same performance as the WRM method. We hypothesize that this occurs because the number of particles $m$ is relatively small for inner SVGD steps. With a small $m$, the resulting sparse repulsive force is too weak to counteract the drift force, thus failing to push the particles apart and maintain diversity. Thus, SVG practically solves the same Wasserstein DRO problem as WRM in this experiment, rather than an entropy-regularized Wasserstein DRO problem. Methods employing Langevin dynamics (WFR, WGF), conversely, remain robust. Although their formulation also stably converges to that of WRM as $\epsilon\rightarrow 0 $, the introduced stochasticity prohibits the samples from collapsing to a single point even when $m$ is small, thereby preventing the model from simply solving a Wasserstein DRO problem. + + +\section{Other Works and Discussion} +Recent works have advanced the understanding and application of Distributionally Robust Optimization (DRO) in continuous probability spaces. +\citep{xu2024flow} proposed FlowDRO, a practical map-based approach that learns a deterministic transport map, parameterized by a sequence of neural networks, to solve the standard Wasserstein DRO problem. +\citep{zhu2024distributionally} provide a foundational theoretical analysis, establishing convergence guarantees for a general iterative min-max framework for discrepancy-based DRO. +Our work is rather orthognal to those efforts in that +it addresses the DRO problems with a sample-based methodology that offers several aforementioned advantages. +An important contribution of this paper is allowing optimizers to go beyond the standard (Wasserstein) gradient descent type of algorithm, inspiring novel approaches such SVG and WFR. + +In this paper, we have provided a complete framework of (stochastic) optimization algorithms for DRO. While the specific algorithms are designed for the Sinkhorn DRO, our theory treats general DRO by changing the corresponding gradient flow energy function $F$ in \eqref{eq:conditional-sampling-energy}. +Therefore, +many more results in analysis and algorithms are possible by choosing various DRO ambiguity notion and gradient flow geometry. + + + + + + + + + + + + + + + + +\appendix + + +\section{Further Background} + +\subsection{Dual approach to Entropy-regularized Wasserstein DRO} +\label{sec:dual-review} +The Sinkhorn DRO problem, as formulated by \citep{wang2021sinkhorn}, aims to find a decision that minimizes the worst-case expected loss over an ambiguity set defined by Sinkhorn divergence, which is identical to entropy-regularized Wasserstein distance in this problem. Given a loss function $\ell(\theta, z)$, a nominal distribution $\widehat{\rho_N}$, and a radius $r > 0$, the primal inner problem is: +\begin{equation} +\sup_{\rho\in \calB_{r, \epsilon}(\widehat{\rho_N})} \E_{z \sim \rho}[\ell(\theta, z)], +\label{eq:appendix-primal} +\end{equation} +where the ambiguity set is $\calB_{r, \epsilon}(\widehat{\rho_N}) := \{ \rho \in \calP(\calZ) : W_{\epsilon}^2(\widehat{\rho_N}, \rho) \le r \}$, and the entropy-regularized Wasserstein distance, +\[W^2_{\epsilon}(\rho_1, \rho_2) = \inf_{\gamma\in \Gamma(\rho_1,\rho_2)} \{\E_{(x,y)\sim\gamma}[c(x,y)] + H(\gamma)\}.\] + +A dual approach, established by \citep{wang2021sinkhorn}, reformulates the inner maximization problem. Using the strong duality of this problem and substituting \eqref{eq:worst-dist} into this problem, the inner problem can be expressed as a minimization over a dual variable $\tau$: +\begin{equation} +\inf_{\tau \ge 0} \left\{ \frac{r}{2\tau} +\frac{\epsilon}{2\tau} \E_{x\sim\widehat{\rho_N}} \left[ \log \E_{y\sim\rho_{x,\epsilon}} \left[ \exp\left(\frac{2\tau\ell(\theta, y)}{\epsilon}\right) \right] \right] \right\}, +\label{eq:appendix-dual} +\end{equation} +where $\rho_{x,\epsilon}(y) = \frac{\exp(\frac{-c(x,y)}{\epsilon})}{Z}$ is a kernel distribution centered at $x$, and $Z$ is a normalizing constant. + +To approximate the value and the gradient of the nested expectation in \eqref{eq:appendix-dual}, \citep{wang2021sinkhorn} employ a two-level sampling procedure for a given $\tau$: first, a sample $x$ is drawn from the nominal distribution $\widehat{\rho_N}$; second, a set of samples are drawn from the kernel distribution $\rho_{x,\epsilon}$ to approximate the inner expectation. + +However, a major limitation of this dual method is that the nested expectation structure in the objective leads to a biased subgradient estimator when using standard Monte Carlo sampling, especially for small values of $\epsilon$. This bias can impede the convergence of the optimization procedure. This challenge motivates the exploration of alternative approaches, such as the gradient flow methods discussed in this paper, which can directly sample from the primal worst-case distribution to obtain a less biased estimate of the gradient. + +\begin{remark} + Consider the KL-DRO problem: + \begin{equation} + \min_\theta \sup_{\rho \ll \rho_0} \left\{ \mathbb{E}_{y \sim \rho}[\ell(\theta, y)] - \frac{1}{2\tau} \KL(\rho \| \rho_0) \right\} \label{eq:dro_objective_modified} + \end{equation} + Let us define a reference distribution $\rho_0(y)$ as a kernel density estimator of the empirical distribution $\widehat{\rho_N} = \frac{1}{N}\Sigma_{i=1}^N \delta(x_i)$: $\rho_0(y) = \frac{1}{N}\Sigma _{i=1}^N K_\epsilon(y,x_i)$, where $K_\epsilon(y,x_i)= \alpha_\epsilon \exp(-c(y,x_i)/\epsilon)$ and $\alpha_\epsilon = \E[\exp(-c(y,x_i)/\epsilon)]^{-1}$. With this choice, and by setting $\tau = \tau'/\epsilon$, the solution to the inner maximization problem is given by \citep{hu2013kullback}: + \begin{align*} + \rho^{\KL}(y) &= \rho_0(y) \cdot \frac{\exp(2\tau'\ell(\theta, y)/\epsilon)}{\mathbb{E}_{y \sim \rho_0}[\exp(2\tau'\ell(\theta, y)/\epsilon)]} \\ + &= \frac{1}{N}\Sigma _{i=1}^N \alpha_\epsilon \beta \exp((2\tau'\ell(\theta, y)- c(y,x_i))/\epsilon), + \end{align*} + where $\beta = \E_{y\sim \rho_0}[\exp(2\tau'\ell(\theta, y)/\epsilon)]^{-1}$. This resulting distribution bears a strong resemblance to the worst-case distribution for entropy-regularized DRO. However, they are not identical, as the normalization constants differ: $\alpha_\epsilon \beta \neq \alpha_x:= \E[\exp((2\tau'\ell(\theta, y)- c(y,x))/\epsilon]^{-1}$. In fact, the term $\alpha_\epsilon \beta \exp((2\tau'\ell(\theta, y)- c(y,x))/\epsilon)$ does not integrate to one and thus does not define a valid conditional probability measure. Actually, $\rho^{\KL}(y)$ can be interpreted as a weighted expectation of conditional distributions: + \[ + \rho^{\KL} = \E_{x\sim\widehat{\rho_N}}[\frac{\alpha_\epsilon \beta}{\alpha_x} \rho_{Y|X=x}] + \] + Consequently, the two-layer sampling procedure requires computing the corresponding weights, sampling from the resulting weighted empirical distribution, and subsequently sampling from the conditional distribution. However, the term $\alpha_x$ is intractable in practice. Therefore, unlike the entropy-regularized DRO case, the KL-DRO problem cannot be directly framed as a two-level sampling task. +\end{remark} + +\subsection{Hellinger-Kantorovich a.k.a. Wasserstein-Fisher-Rao Gradient Flows} + +Consider the WFR gradient system of the energy functional $F$, i.e., the triple $\left( \calP, F, \WFR \right)$, where $\WFR$ is the Wasserstein-Fisher-Rao metric, a.k.a. the \emph{Hellinger-Kantorovich} metric restricted to the probability space. +Specifically, we consider the HK/WFR gradient system associated with reaction-diffusion PDE: +\begin{align} + {{\partial_t} \mu} + &= \alpha\, \mathrm{div} \left( \mu \nabla \frac{\delta F}{\delta \mu} \right) - \beta\, \mu + \left(\frac{\delta F}{\delta \mu} - \int \frac{\delta F}{\delta \mu}\dd \mu \right) + . +\end{align} +The hope of this gradient flow is that the added reaction term on the right-hand side will help the gradient flow to converge more rapidly. +This can be formally seen by checking the time derivative of the energy functional $F$ along the gradient flow \eqref{eq:wfr-gradient-flow}, we have +\begin{align*} + {\partial_t} F (\rho_t) + \overset{\text{(EDB)}}{=} + -\alpha \int \Bigg|\nabla \log \frac{\rho}{\pi}(x) \Bigg| ^2\dd \rho (x) + -\beta \int \Bigg| \log \frac{\rho}{\pi}(x) + - + \KL(\rho | \pi) + \Bigg| ^2\dd \rho (x) + \end{align*} +where we used the Energy-Dissipation Balance (EDB, a.k.a. equality) of gradient flows. +We observe the right-hand side is non-positive, hence its dissipation will be faster than the original pure Wasserstein gradient flow. + +However, we must note that there is no global PL or strong convexity analogous to the case of the Wasserstein gradient flow, as discussed in the main text. +A ``warm-start'' condition is necessary as it has been shown that global PL/gradient dominance cannot hold for the Fisher-Rao/(spherical)Hellinger gradient flows; see \citep{mielke2025hellinger,carrillo2024fisher} for details. +There exist fine-grained warm-start initialization conditions in the gradient flow literature; see \citep{luBirthdeathDynamicsSampling2023,luAcceleratingLangevinSampling2019,chen2023sampling}. + +For example, \citep{luBirthdeathDynamicsSampling2023} +showed that, after a warm-start initialization in the form of a density-ratio lower bound, it is possible to get an improved exponential convergence rate +than the pure Wasserstein gradient flow as characterized in Lemma~\ref{lemma:gradient-dominance-PL-Wasserstein}. +However, it is important to note that +the specific warm-start initialization condition cannot be verified in our DRO problems. +Nonetheless, in practice, we observe significant speedups using the WFR gradient flow as compared to the pure Wasserstein gradient flow. + +\section{Further Methods} + +\subsection{Using SVGD to Sample from the Worst-Case Distribution}\label{sec:svg} +Stein Variational Gradient Descent (SVGD) is a variational inference algorithm that approximates a target probability density $p(x)$ by iteratively transporting a set of particles $\{ x_i \}_{i=1}^n$ \citep{liu2016stein}. The method is formulated as a functional gradient descent on the Kullback-Leibler (KL) divergence, $\text{KL}(q||p)$, where $q$ represents the empirical distribution of the particles. The particle updates are governed by a velocity field $\phi(x_i)$ that corresponds to the direction of steepest descent. For an empirical measure of $n$ particles, this update is given by: +\begin{equation*} +\boldsymbol{\phi}(x_i) \propto \frac{1}{n} \sum_{j=1}^n \left[ k(x_j, x_i) \nabla_{x_j} \log p(x_j) + \nabla_{x_j} k(x_j, x_i) \right] +\end{equation*} +This update rule can be decomposed into two functional components: (i) a driving force, which is a kernel-smoothed average of the score function $\nabla \log p(x)$ that directs particles towards the modes of the target distribution, and (ii) a repulsive force, which arises from the kernel gradient $\nabla k(\cdot, \cdot)$ and ensures particle diversity to prevent mode collapse \citep{ba2021understanding}. + +The iterative application of this update rule forms the basis of the SVGD algorithm. As detailed in \citep{liu2016stein}, its computational complexity is dominated by the pairwise kernel computations, resulting in a cost of $O(m^2d)$ per iteration for $m$ particles in $d$ dimensions. Regarding convergence, theoretical guarantees have been established under certain assumptions. As shown by \citep{salim2022convergence}, for target distributions that satisfy Talagrand's T1 inequality, a finite-iteration complexity bound is derived. A finite-particle convergence analysis is also provided in \citep{shi2023finite}. + +By applying SVGD to sample from the worst-case distribution, we arrive at Algorithm \ref{alg:SDRO-SVG}. + +\begin{algorithm}[h!] +\caption{Sinkhorn DRO via SVGD} +\label{alg:SDRO-SVG} +\begin{algorithmic}[1] + \State \textbf{Input:} Empirical distribution $\widehat{\rho_N}$, constraint set $\Theta$, $\tau, \epsilon >0$, stepsize sequence $\{r_s > 0\}_{s=0}^{S-1}$, inner stepsize $\eta$, inner iterations $T$, initial deviation $\sigma$, number of samples $m$. + \For{$s = 0, \dots, S-1$} + \State Sample $x^s \sim \widehat{\rho_N}$ + \State Sample $\xi^{s,i}\sim\mathcal{N}(0,\sigma I) ,\, i=1,...,m$ + \State Initialize $y^{s,i}_0 \leftarrow x^s + \xi^{s,i}$ + \For{$t = 0, \dots, T-1$} + \State $\phi^{s,i}_t = \frac{1}{m}\sum_{j=1}^m\left[k(y^{s,i}_t, y^{s,j}_t)\nabla\widetilde V_{x^s, \tau}(y^{s,j}_t) + \nabla_2 k(y^{s,i}_t, y^{s,j}_t) \right]$ + \State $y^{s,i}_{t+1}= y^{s,i}_t + \phi^{s,i}_t$ + \EndFor + \State $\theta^{s+1} \leftarrow \text{Proj}_\Theta (\theta^s-r_s \sum_{i=1}^m \frac{1}{m}\nabla_\theta \ell(\theta^{s},y^{s,i}_T))$ + \EndFor + \State \textbf{return} $\theta^S$ +\end{algorithmic} +\end{algorithm} + +However, the empirical performance of Algorithm~\ref{alg:SDRO-SVG} is suboptimal. We observe that the convergence is sensitive to the initialization of the particles. Furthermore, when the number of particles $m$ is small, the magnitude of the driving force to dominate the repulsive force, thereby diminishing the variance. In this regime, the SVGD algorithm degenerates into a simple gradient descent method, losing its sampling capabilities. This behavior is demonstrated empirically in Section~\ref{sec:experiment3}. + + +\subsection{Using RGO to Sample form the Worst-case Distribuion}\label{sec:rgo} + +In this section, we explore an alternative approach for sampling from the worst-case distribution based on Proximal Sampler. The \textit{Proximal Sampler} \citep{lee2021structured} was introduced to unbiasedly sample from Gibbs distributions of the form $\nu(x) \propto \exp(-f(x))$. A single iteration of the proximal sampler consists of the following two steps: +\begin{enumerate} + \item (\textbf{Forward step}): Sample $y_k \mid x_k \sim \nu_\tau^{Y|X}(\cdot \mid x_k) = \mathcal{N}(x_k, \tau I)$. This results in a new iterate $y_k \sim \rho^Y_k$, where $\rho^Y_k = \rho^X_k * \mathcal{N}(0, \tau I)$. + \item (\textbf{Backward step}): Sample $x_{k+1} \mid y_k \sim \nu_\tau^{X|Y}(\cdot \mid y_k)$. This gives the next iterate $x_{k+1} \sim \rho^X_{k+1}$. +\end{enumerate} + + +As shown in recent work \citep{chen2022improved}, this forward-backward procedure is equivalent to an entropy-regularized Jordan-Kinderlehrer-Otto (JKO) scheme : +\begin{align}\label{eq:forward_app} + \rho_k^Y &= \arg\min_{\mu \in P_2(\mathbb{R}^d)} \left\{ \frac{1}{2\tau} W^2_{2\tau}(\rho_{k}^{X}, \mu) \right\}, \\ + \rho_{k+1}^{X} &= \arg\min_{\mu \in P_2(\mathbb{R}^d)} \left\{ \int f \, d\mu + \frac{1}{2\tau} W^2_{2\tau}(\rho_{k}^{Y}, \mu) \right\}, \label{eq:backward_app} +\end{align} +This connection to the entropy-regularized JKO scheme provides a new perspective to our problem. By reformulating our original Lagrangian problem (\eqref{eq:main-ent-dro}) as a minimization and specializing the cost to the squared Euclidean distance, we obtain: +\begin{equation}\label{pb:sinkhornscheme_modified} + \Phi(\theta)=\min_{\rho\in\calP} \{\E_{y\sim\rho}[-\ell(\theta, y)] + \frac{1}{2\tau} W^2_{\epsilon}(\rho,\widehat{\rho_N})\}, +\end{equation} +which precisely matches the form of the problem \eqref{eq:backward_app} solved by backward step. This structural equivalence suggests that methods developed for proximal sampler can be directly applied to solve the entropy-regularized DRO problem. Specifically, we can employ the \textit{Restricted Gaussian Oracle (RGO)} from \citep{lee2021structured} to solve this. The sampling process for a given $x \sim \widehat{\rho_N}$ involves two steps: +\begin{enumerate}\label{alg:rejection-sampling} + \item Sample $x$ from $\widehat{\rho_N}$, and compute the minimizer \( y^*_{x, \tau} = \arg\min_{y \in \mathbb{R}^d} \{\widetilde V_{x, \tau}(y)\} \). + \item Repeat until acceptance: draw a sample \( Z \sim \mathcal{N} \left( y^*_{x, \tau}, \frac{\epsilon}{2(1 - L\tau)} I \right) \) and accept it with probability + \[ + \exp \left(- \widetilde V_{x, \tau}(Z) +\widetilde V_{x, \tau}(y^*_{x, \tau}) + \frac{2(1 - L\tau)}{\epsilon} \| Z - y^*_{x, \tau} \|^2 \right). + \] +\end{enumerate} + + +The validity of the RGO sampler requires the loss function $\ell$ to be $L$-smooth, and the penalty parameter $\tau$ must satisfy $\tau < 1/L$. This condition ensures that the auxiliary function $\widetilde V_{x, \tau}(y)$ is $(\frac{2(1-L\tau)}{\epsilon})$-strongly convex, which is crucial for rejection sampling. Applying RGO to the entropy-regularized DRO problem necessitates that the loss function is $L$-smooth and requires solving a convex optimization subproblem in each step. These requirements on the loss function and the computational structure are analogous to the WRM algorithm presented in \citep{sinha2020certifyingdistributionalrobustnessprincipled} for the specific case of a squared Euclidean cost. However, a key difference exists: the WRM algorithm transports each data point to a single worst-case point, whereas in entropy-regularized DRO, each data point induces a full continuous distribution of worst-case scenarios. +\begin{algorithm} +\caption{Sinkhorn DRO via RGO} +\label{alg:SDRO_rgo} +\begin{algorithmic}[1] % + \State \textbf{Input:} Empirical distribution $\widehat{\rho_N}$, constraint sets $\Theta$, $\tau, \epsilon > 0$, stepsize sequence $\{r_s > 0\}^{S-1}_{s=0}$ + \For{$s = 0, ..., S-1$} + \State Sample $x^s \sim \widehat{\rho_N}$ and find an $\eta$-approximate minimizer $\hat{y}^s$ of $\widetilde{V}_{\tau,x^s}(y)$ + \State Generate samples $\{y^{s,i}\}_{i=1}^m$ via rejection sampling + \State $\theta^{s+1} = \text{Proj}_\Theta (\theta^s-\frac{r_s}{m}\Sigma^m_{i=1} \nabla_\theta \ell(\theta^{s}, y^{s,i}))$ + \EndFor + \State \textbf{return} $\theta^S$ +\end{algorithmic} +\end{algorithm} + + +\begin{remark} +Although WRM\citep{sinha2020certifyingdistributionalrobustnessprincipled} assumes an $L$-smooth loss, its algorithm is “parameter-free” – it never needs to know $L$ and works whenever the inner optimization problem admits a closed-form solution. In contrast, Algorithm \ref{alg:SDRO_rgo} requires explicit knowledge of $L$ and cannot be applied if the loss fails to be $L$-smooth. In practice, we may assume $\tau$ is sufficiently small such that $\tau < 1/L$, and $\ell$ is $L$-smooth for all $y$. +\end{remark} + + +\section{Proofs of Theoretical Results} \label{ap:complexity_proofs} + +\subsection{Proof of Lemma \ref{lem:sb-klform}} +\begin{proof}[Proof of Lemma \ref{lem:sb-klform}] + We rewrite the problem using the definition of the entropy-regularized OT formulation: + \begin{align} + \min_{\rho} \min _{\Pi} + \biggl\{ + \int V \dd \rho + \frac{1}{2\tau } + \int c(x,y) \dd\Pi + \frac\epsilon{2\tau}\int \log \Pi \dd\Pi + \biggr\} + \end{align} + subject to the margianl constraints $\int \Pi \dd x = \rho$ and $\int \Pi \dd y = \rho_0$. + Here, + $\rho_0$ can be set to empirical distribution $\widehat{\rho_N}$ as in the data-driven DRO problem. + Using the marginal constraints, + we can then write the first linear term as + $\int \int V(y) \dd \Pi(x, y)$ and eliminate the variable $\rho$, i.e., one end is unconstrained -- hence it's the half bridge problem: + \begin{align} + \min _{\Pi} + \biggl\{ + \int V \dd \Pi + \frac{1}{2\tau } + \int c(x,y) \dd\Pi + \frac\epsilon{2\tau}\int \log \Pi \dd\Pi + \, \, + \bigg | + \int \Pi \dd y = \rho_0 + \biggr\} + . + \end{align} + After straightforward linear optimization, + we obtain the optimal solution to the variational problem~\eqref{eq:proximal-EOT} as + \begin{align} + \rho^* \propto \E_{x\sim \rho_0} \left[ + \exp + \left[{-\frac{2\tau V(y) +c(y, x^i_k) }{\epsilon}} \right] + \right], + \end{align} + which is a mixture of proximal distributions \eqref{eq:conditional-sampling-density}. + Using elementary manipulations, the variational problem \eqref{eq:proximal-EOT} + can also be written down as the minimization of the expected KL divergence: + \begin{align} + \min_{\rho_{Y|X}} + \mathbb{E}_{x\sim\rho_0} + \KL + \left( + \rho_{Y|X=x}(y) + \bigg| + \dfrac{1}{Z_x} + \exp \left[ + -\dfrac{2\tau V(y) + c(y,x)}{\epsilon} + \right] + \right) + . + \end{align} +\end{proof} + +\subsection{Proof of Proposition~\ref{prop:gradient_oracle_error_control}} +First, we recall some standard results. +\begin{lemma} + \label{lemma:displacement-convexity} + Suppose the first condition in Definition~\ref{as:gf-properties} holds for some $\lambda > 0$. Then, + $F$ is $\lambda$-displacement convex. +\end{lemma} + +\begin{lemma}[WGF gradient dominance/PL] + \label{lemma:gradient-dominance-PL-Wasserstein} + Let $\rho_t$ be a solution to the Wasserstein gradient flow of the KL divergence energy functional $\KL(\rho | \exp(-\widetilde V_{x, \tau}))$. Then, +\begin{align*} + \text{$\widetilde V$ is $\lambda$-displacement convex or $\lambda$-PL} + \implies + \KL(\rho_t| \exp(-\widetilde V_{x, \tau})) + \leq + \ee^{-2\lambda t} \KL(\rho_0| \exp(-\widetilde V_{x, \tau})). +\end{align*} +\end{lemma} + +\begin{lemma}[Talagrand's inequality] + Under the same assumptions as in Lemma \ref{lemma:gradient-dominance-PL-Wasserstein}, we have + \label{lemma:talagrand-inequality} +\[ +W_2^2(\rho_t, \exp(-\widetilde V_{x, \tau})) \leq +\sqrt{\frac2\lambda \KL(\rho_t | \exp(-\widetilde V_{x, \tau}))} +\] +\end{lemma} +Recall also that $W_1(\rho_t, \rho^*_{Y|X=x}) \leq W_2(\rho_t, \rho^*_{Y|X=x})$. + + +\textbf{From conditional to marginal bound} +We have the following relation between the marginal and conditional KL divergences. +Suppose $\rho_X$ is the marginal distribution of $X$. +Recall the relation $\pi_Y = \int_x \rho^* _{Y|X=x} \dd \rho_X(x)$. +Then, +\[ +\KL(\rho_Y | \pi_{Y}) \leq \mathbb{E}_{X \sim \rho_X} \left[ \KL\left(\rho_{t, Y|X} \middle| \rho^*_{Y|X}\right) \right]. +\] + +Alternatively, the Wasserstein relation gives +\[ +W_p(\rho_Y, \pi_Y) \leq \mathbb{E}_{X \sim \rho_X} \left[ W_p(\rho_{Y|X}(\cdot|X), \rho^*_{Y|X}(\cdot|X)) \right]. +\] + +\textbf{Marginal distribution error control} +Suppose we have the samples +$y^i_t\sim \rho_t$, +Our goal is to use the empirical measure +$\displaystyle\widehat{\rho_Y} = \frac1N \sum_{i=1}^N \delta_{y^i_t}$ +to approximate $\pi_Y$. +An elementary manipulation shows that + \begin{align} + W_1(\widehat{\rho_Y}, \pi_Y) + &\leq \mathbb{E}_{X \sim \rho_X} \left[ W_1(\widehat\rho_{Y|X}, \rho^*_{Y|X}) \right] + \lesssim \frac{{\ee^{-\lambda t}}}{\sqrt{\lambda}} + \label{eq:marginal_w1_decay} + \end{align} + +Therefore, to reach an $\epsilon$-solution, we need to run the gradient flow (i.e. simulating the PDE/SDE) for time +\begin{align} + t \gtrsim \frac{1}{\lambda}\log{\frac1{\sqrt{\lambda}\epsilon}} + . + \label{eq:gf_time_to_epsilon} +\end{align} + +We will later show the discrete-time gradient descent version of this result. + +We emphasize that the continuous-time gradient flow result is important not only for understanding the limit of discrete-time algorithms, but also for serving as a guide for designing new discrete-time algorithms. +Let us get a quick insight from the above estimate: +suppose we discretized algorithm with discretization step size $\eta$ for in total $T$ steps. Ignoring the discretization error, we have $t = T\eta$ and the (ideal) number of iterations needed to reach an $\epsilon$-solution +of the inner maximization problem~\eqref{eq:entropic-jko} +is $T \gtrsim \frac{1}{\eta \lambda}\log{\frac1{\sqrt{\lambda}\epsilon}}$. + +\textbf{DRO gradient oracle error control via gradient flow} +Let us now show how to convert the error estimate in distributions to the error estimate in the gradient oracle, needed for the optimization analysis later. +If $W_1(\widehat{\rho_Y}, \pi_Y) \leq \delta$ for some $\delta > 0$ (as controlled by \eqref{eq:marginal_w1_decay}) and $g$ is $L$-Lipschitz (w.r.t. Euclidean norm). +Then, +taking expectations and using the optimal transport plan +(coupling) $\gamma$ of $(X, Y) \sim (\widehat{\rho_Y}, \pi_Y)$, +we obtain: +\begin{align} + \label{eq:gradient_oracle_error_control_expectation} + \left| \int g\, d(\widehat{\rho_Y} - \pi_Y) \right| += \left|\int g(x) - g(y)\dd\gamma(x, y)\right| +\leq L W_1(\widehat{\rho_Y}, \pi_Y) +\leq L\delta. +\end{align} + +In the optimization analysis, we can later take $g$ to be the gradient oracle of the DRO loss, $g:=\nabla_\theta \ell(\theta, \cdot)$, to control the gradient oracle error. +Recall that $\widehat{\rho_Y} = \frac1N \sum_{i=1}^N \delta_{y^i_t}$ is the particle approximation obtained by running the gradient flow sampler for $t$ steps, and $\pi_Y$ is the target marginal distribution, which is the worst-case distribution of DRO inner maximization problem~\eqref{eq:entropic-jko}. +Then, +\eqref{eq:gradient_oracle_error_control_expectation} results in the following +bound on the gradient oracle error: +\begin{multline} + \label{eq:gradient_oracle_error_control} +\bigg|\frac1N \sum_{i=1}^N \nabla_\theta \ell(\theta, y^i_t) +- +\nabla_\theta +\underbrace{ +\max _{\rho \in \calP} +\biggl( + \int \ell(\theta, z)\dd\rho{(z)} + -\frac1{2\tau} W_\epsilon^2(\rho, \widehat{\rho_N}) +\biggr) +}_{\text{DRO objective}} +\bigg| +\\ += +\bigg|\frac1N \sum_{i=1}^N \nabla_\theta \ell(\theta, y^i_t) +- +\mathbb{E}_{y \sim \pi_Y} +\nabla_\theta\ell(\theta, y) +\bigg| +\overset{\eqref{eq:gradient_oracle_error_control_expectation}}{\leq} +L\delta. +\end{multline} + +Replacing $L\delta$ by $\epsilon$, we obtain the desired bound on the gradient oracle error as in Proposition~\ref{prop:gradient_oracle_error_control}. + + + + + + + +\subsection{Proof of Theorem \ref{thm:outer_loop} (Outer Loop Convergence)} +\label{ap:proofth1} +We provide a detailed proof for the convergence of the outer loop, which follows the standard analysis for non-convex Stochastic Gradient Descent with a persistent bias. + +\begin{lemma}[Bias of the Stochastic Gradient] +Under Assumptions \ref{as:totalsmooth}, \ref{as:fsmooth}, the bias of the stochastic gradient estimator, defined as $B(\theta) := \E_{} [\widehat g] - \nabla\Phi(\theta)$, is bounded as: +$$\|B(\theta)\| \le L_f \cdot \delta_{\text{sample}}.$$ +\end{lemma} +\begin{proof} +By definition, the bias is +\begin{align*} + B(\theta) &= \E_{x \sim \widehat{\rho_N}}\left[\E_{y \sim \widehat\rho_{Y|X=x}}[\nabla_\theta \ell(\theta, y)]\right] - \E_{x \sim \widehat{\rho_N}}\left[\E_{y \sim \rho^*_{Y|X=x}}[\nabla_\theta \ell(\theta, y)]\right] \\ + &= \E_{x \sim \widehat{\rho_N}}\left[ \E_{y \sim \widehat\rho_{Y|X=x}}[\nabla_\theta \ell(\theta, y)] - \E_{y \sim \rho^*_{Y|X=x}}[\nabla_\theta \ell(\theta, y)] \right]. +\end{align*} +Taking norms and using Jensen's inequality: +$$\|B(\theta)\| \le \E_{x \sim \widehat{\rho_N}}\left[ \| \E_{y \sim \widehat\rho_{Y|X=x}}[\nabla_\theta \ell(\theta, y)] - \E_{y \sim \rho^*_{Y|X=x}}[\nabla_\theta \ell(\theta, y)] \| \right].$$ +For any two probability measures $\rho_1, \rho_2$ and a function $h$ that is $L_h$-Lipschitz, we know that $\|\E_{\rho_1}[h(y)] - \E_{\rho_2}[h(y)]\| \le L_h W_1(\rho_1, \rho_2)$. Applying this with $h(y) = \nabla_\theta \ell(\theta, y)$, which is $L_f$-Lipschitz in $y$ by Assumption 2, gives: +\begin{align*} + \|B(\theta)\| &\le \E_{x \sim \widehat{\rho_N}}\left[ L_f \cdot W_1(\widehat\rho_{Y|X=x}, \rho^*_{Y|X=x}) \right] \\ + &\le L_f \cdot \E_{x \sim \widehat{\rho_N}}\left[ W_2(\widehat\rho_{Y|X=x}, \rho^*_{Y|X=x}) \right] \quad (\text{since } W_1 \le W_2) \\ + &\le L_f \cdot \delta_{\text{sample}}. +\end{align*} +\end{proof} + +\noindent\textbf{Proof of Theorem \ref{thm:outer_loop}.} +From the $L_\Phi$-smoothness of $\Phi$ (Assumption \ref{as:totalsmooth}), we have the standard descent lemma. For simplicity, we assume $\Theta = \mathbb{R}^d$ and a constant step size $r_s = r$. +\begin{align*} + \Phi(\theta^{s+1}) &\le \Phi(\theta^s) + \langle \nabla\Phi(\theta^s), \theta^{s+1} - \theta^s \rangle + \frac{L_\Phi}{2}\|\theta^{s+1} - \theta^s\|^2 \\ + &= \Phi(\theta^s) - r \langle \nabla\Phi(\theta^s), \widehat g^s \rangle + \frac{L_\Phi r^2}{2}\|\widehat{g}^s\|^2. +\end{align*} +Taking expectation conditioned on the filtration $\mathcal{F}_s$: +\begin{align*} + \E[\Phi(\theta^{s+1})|\mathcal{F}_s] &\le \Phi(\theta^s) - r \langle \nabla\Phi(\theta^s), \E[\widehat{g}^s|\mathcal{F}_s] \rangle + \frac{L_\Phi r^2}{2}\E[\|\widehat{g}^s\|^2|\mathcal{F}_s] \\ + &= \Phi(\theta^s) - r \langle \nabla\Phi(\theta^s), \nabla\Phi(\theta^s) + B(\theta^s) \rangle + \frac{L_\Phi r^2}{2} \left( \|\E[\widehat{g}^s|\mathcal{F}_s]\|^2 + \text{Var}(\widehat{g}^s|\mathcal{F}_s) \right). +\end{align*} +Using the variance bound and the bias definition: +\begin{align*} + \E[\Phi(\theta^{s+1})|\mathcal{F}_s] &\le \Phi(\theta^s) - r\|\nabla\Phi(\theta^s)\|^2 - r\langle \nabla\Phi(\theta^s), B(\theta^s) \rangle + \frac{L_\Phi r^2}{2} \left( \|\nabla\Phi(\theta^s)+B(\theta^s)\|^2 + \sigma^2 \right). +\end{align*} +Applying Young's inequality to the inner product term: +$$-r\langle \nabla\Phi(\theta^s), B(\theta^s) \rangle \le \frac{r}{2}\|\nabla\Phi(\theta^s)\|^2 + \frac{r}{2}\|B(\theta^t)\|^2.$$ +Substituting this in and simplifying with $\|a+b\|^2 \le 2\|a\|^2 + 2\|b\|^2$: +$$\E[\Phi(\theta^{s+1})|\mathcal{F}_s] \le \Phi(\theta^s) - \frac{r}{2}\|\nabla\Phi(\theta^s)\|^2 + \frac{r}{2}\|B(\theta^s)\|^2 + L_\Phi r^2 (\|\nabla\Phi(\theta^s)\|^2 + \|B(\theta^s)\|^2) + \frac{L_\Phi r^2 \sigma^2}{2}.$$ +Rearranging terms to isolate $\|\nabla\Phi(\theta^s)\|^2$: +$$r\left(\frac{1}{2} - L_\Phi r\right)\|\nabla\Phi(\theta^s)\|^2 \le \Phi(\theta^s) - \E[\Phi(\theta^{s+1})|\mathcal{F}_s] + \left(\frac{r}{2} + L_\Phi r^2\right)\|B(\theta^s)\|^2 + \frac{L_\Phi r^2 \sigma^2}{2}.$$ +Choosing a step size $r \le \frac{1}{4L_\Phi}$, we have $(\frac{1}{2} - L_\Phi r) \ge \frac{1}{4}$ and $(\frac{r}{2} + L_\Phi r^2) \le r$. This gives: +$$\frac{r}{4}\|\nabla\Phi(\theta^s)\|^2 \le \Phi(\theta^s) - \E[\Phi(\theta^{s+1})|\mathcal{F}_s] + r\|B(\theta^s)\|^2 + \frac{L_\Phi r^2 \sigma^2}{2}.$$ +Taking total expectation and using Lemma 1, $\|B(\theta^s)\|^2 \le (L_f \delta_{\text{sample}})^2$: +$$\frac{r}{4}\E[\|\nabla\Phi(\theta^s)\|^2] \le \E[\Phi(\theta^s)] - \E[\Phi(\theta^{s+1})] + r (L_f \delta_{\text{sample}})^2 + \frac{L_\Phi r^2 \sigma^2}{2}.$$ +Summing from $s=0$ to $S-1$ yields a telescoping sum: +$$\frac{r}{4}\sum_{s=0}^{S-1}\E[\|\nabla\Phi(\theta^s)\|^2] \le \Phi(\theta^0) - \E[\Phi(\theta^S)] + Sr(L_f \delta_{\text{sample}})^2 + \frac{S L_\Phi r^2 \sigma^2}{2}.$$ +Dividing by $\frac{r S}{4}$ and using $\E[\Phi(\theta^S)] \ge \Phi_{\inf}$: +$$\frac{1}{S}\sum_{s=0}^{S-1}\E[\|\nabla\Phi(\theta^s)|^2] \le \frac{4(\Phi(\theta^0) - \Phi_{\inf})}{r S} + 4(L_f \delta_{\text{sample}})^2 + 2L_\Phi r \sigma^2. $$ + + + + +\subsection{Derivation of ULA Sampler Complexity (for Theorem~\ref{thm:ula})} +\label{ap:ula_derivation} +The complexity of the ULA sampler depends on the geometric properties of the inner target distribution $\rho_{Y|X=x}$. +Under Assumption \ref{as:LSI}, standard results on ULA convergence \citep{vempala2019rapid} state that after $T$ steps, the KL-divergence to the target is bounded. To achieve a final KL-divergence of $\delta_{KL}$, the number of iterations required is $T = O\left(\frac{L_U^2 d}{\alpha_U^2 \delta_{KL}}\log \frac{1}{\delta_{KL}}\right) = \tilde{O}\left(\frac{L_U^2 d}{\alpha_U^2 \delta_{KL}}\right)$. + +Our goal is to connect the required outer-loop sampling accuracy $\delta_{\text{sample}}$ (in $W_2$ distance) to the required inner-loop KL-divergence accuracy $\delta_{KL}$. Under the LSI assumption, Talagrand's inequality gives the relationship: +$$ W_2^2(\widehat \rho_{Y|X=x} , \rho_{Y|X=x}) \le \frac{2}{\alpha_U} \KL(\widehat \rho_{Y|X=x} || \rho^*_{Y|X=x}) $$ +From Theorem \ref{thm:outer_loop}, we require $W_2(\widehat \rho_{Y|X=x}, \rho_{Y|X=x}) \le \delta_{\text{sample}} = O(\epsilon_{\text{opt}}/L_f)$. This implies we need to achieve a KL-divergence of: +$$ \delta_{KL} \le \frac{\alpha_U}{2} W_2^2(\widehat \rho^*_{Y|X=x}, \rho_{Y|X=x}) = O\left(\alpha_U \frac{\epsilon_{\text{opt}}^2}{L_f^2}\right). $$ +Substituting this required $\delta_{KL}$ into the ULA iteration complexity gives the number of inner loop steps: +$$ T_{ULA} = \tilde{O}\left(\frac{L_U^2 d}{\alpha_U^2 \cdot \alpha_U \frac{\epsilon_{\text{opt}}^2}{L_f^2}}\right) = \tilde{O}\left(\frac{L_U^2 L_f^2 d}{\alpha_U^3 \epsilon_{\text{opt}}^2}\right). $$ +The total complexity is the product of outer iterations $S = O(1/\epsilon_{\text{opt}}^2)$, inner iterations $T_{ULA}$, and the cost per inner gradient step $C_{\nabla_z} = O(d)$. +\begin{align*} +\text{Complexity} &= S \times T \times C_{\nabla_{z}} \\ +&= O\left(\frac{1}{\epsilon_{\text{opt}}^{2}}\right) \times \tilde{O}\left(\frac{L_U^2 L_f^2 d}{\alpha_U^3 \epsilon_{\text{opt}}^2}\right) \times O(d) \\ +&= \tilde{O}\left(\frac{L_U^2 L_f^2 d^2}{\alpha_U^3 \epsilon_{\text{opt}}^4}\right). +\end{align*} +Note that we absorb constants like $L_{\Phi}$ into the $\tilde{O}(\cdot)$ notation. This completes the derivation for Theorem \ref{thm:ula}. + +\subsection{Complexity of RGO} +We analyze the computational complexity of RGO method under specific regularity conditions on the loss function. + +\begin{theorem}[Complexity of RGO Sampling] +\label{thm:rgo_complexity} +Let the loss function $\ell: \mathbb{R}^d \to \mathbb{R}$ be $L$-smooth. For parameter $\tau = \frac{1}{Ld}$ and a target distribution $\rho^*_{Y|X=x}$, though the rejection sampling procedure descrided in Section \ref{sec:rgo}, we can draw a sample from a distribution $\tilde{\rho}_{Y|X=x}$ such that the Kullback-Leibler (KL) divergence satisfies $\KL(\tilde{\rho}_{Y|X=x} || \rho^*_{Y|X=x}) < \delta$ with the iteration-complexity bound: +\[O(\log\left(\frac{1}{\epsilon\delta}\right)) \] +\end{theorem} + +\begin{proof} +Under the assumption that $\ell$ is $L$-smooth and $\tau < \frac{1}{L}$, $\widetilde V_{x, \tau}(y)$, is $\frac{2-2\tau L}{\epsilon}$-strongly convex and $\frac{2+2\tau L}{\epsilon}$-smooth. + +Let the minimizer of $\widetilde V_{x, \tau}(y)$ as $y^*_{x, \tau}$. To find the minimum of $\widetilde V_{x, \tau}(y)$, we can apply gradient descent. The number of iterations required to achieve a $\delta'$-approximate optimal solution $\tilde{y}$ is determined by the condition number $\kappa = \frac{1+\tau L}{1-\tau L}$. Specifically, the iteration complexity is: +$$ O\left(\kappa \log\left(\frac{1}{\delta'}\right)\right) = O\left(\frac{1+\tau L}{1-\tau L}\log\left(\frac{1}{\delta'}\right)\right) $$ + + +\textbf{2. Distributional Proximity.} +Let the distribution obtained via rejection sampling with a $\delta'$-approximate optimal solution for the proposal be denoted by $\tilde{\rho}_{Y|X=x}$. The procedure defines the proposal distributions $p(y)$ (using the true minimizer $y^*_{x,\tau}$) and $\tilde{p}(y)$ (using the approximate minimizer $\tilde{y}$) as Gaussian distributions: +\[ p(y) = \mathcal{N} \left( y \mid y^*_{x,\tau}, \frac{\epsilon}{2 - 2\tau L} I \right), \quad \tilde{p}(y) = \mathcal{N} \left( y \mid \tilde{y}, \frac{\epsilon}{2 - 2\tau L} I \right) \] +The corresponding acceptance probabilities $a(y)$ and $\tilde{a}(y)$ are given by: +\begin{align*} + a(y) &= \exp \left( - \widetilde V_{x, \tau}(y) + \widetilde V_{x, \tau}(y^*_{x,\tau}) + \frac{1 - \tau L }{\epsilon} \| y - y^*_{x,\tau} \|^2 \right) \\ + \tilde{a}(y) &= \min\left\{\exp \left( - \widetilde V_{x, \tau}(y) + \widetilde V_{x, \tau}(\tilde{y}) + \frac{1 - \tau L }{\epsilon} \| y - \tilde{y} \|^2 \right), 1\right\} +\end{align*} +The resulting KL divergence from the distribution obtained with the true minimizer, $\rho_{\theta,x}$, is +\begin{align} + \KL(\tilde{\rho}_{Y|X=x}||\rho_{Y|X=x}) &= \int \frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)} \log \left(\frac{\frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)}}{\frac{a(y)p(y)}{\int a(y)p(y)}}\right) dy\\ + &= \int \frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)} \left(\log \left(\frac{\tilde{a}(y)\tilde{p}(y)}{a(y)p(y)}\right) + \log\left(\frac{\int a(y)p(y)}{\int \tilde{a}(y)\tilde{p}(y) }\right) \right) dy + \\ + &\leq\int \frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)}\cdot 2 \left(\widetilde V_{x, \tau}(\tilde{y})-\widetilde V_{x, \tau}(y^*_{x, \tau}) \right) dy + \\ + &\leq\int \frac{\tilde{a}(y)\tilde{p}(y)}{\int \tilde{a}(y)\tilde{p}(y)}\cdot \frac{4+4\tau L}{\epsilon} \delta' dy + = \frac{4+4\tau L}{\epsilon}\delta' +\end{align} + +To ensure the final KL divergence is less than $\delta$, we must set the optimization accuracy to $\delta' < \frac{\epsilon}{4+4\tau L}\delta$. This implies an optimization complexity of $O\left(\frac{1+\tau L}{1-\tau L}\log\left(\frac{4+4\tau L}{\epsilon\delta}\right)\right)$. + +\textbf{3. Rejection Sampling Efficiency.} +The expected number of iterations until acceptance is at most $\left(\frac{1+\tau L}{1-\tau L}\right)^{d/2}$\citep{chewi2022query}. Note that if we choose $\tau = \frac{1}{Ld}$, then the +expected number of iterations until acceptance is at most $\left(\frac{1+\tau L}{1-\tau L}\right)^{d/2} = \left(\frac{1+1/d}{1-1/d}\right)^{d/2} = O(1)$. +As $d \to \infty$, this expression converges to $e$. Thus, for this choice of $\tau$, the expected number of rejection sampling trials is $O(1)$. + +\textbf{4. Total Complexity.} +The total complexity is the product of the optimization complexity and the expected number of rejection sampling iterations. With $\tau = \frac{1}{Ld}$, the condition number becomes $\kappa = \frac{d+1}{d-1}$. +More precisely, the complexity is: +\[ +O\left(\left(\frac{d+1}{d-1}\right)^{\frac{d}{2} + 1} \times\log\left(\frac{4d+4}{d\epsilon\delta}\right) \right) = O(\log\left(\frac{1}{\epsilon\delta}\right)) +\] +This completes the proof. +\end{proof} + +\begin{remark}[Practical Limitations] +The theoretical complexity presented in Theorem \ref{thm:rgo_complexity} is highly compelling when compared to alternative sampling methodologies. However, its applicability is constrained by stringent underlying assumptions. +\begin{enumerate} + \item \textbf{Smoothness Requirement:} The analysis presupposes that the loss function $\ell$ is $L$-smooth. In many practical applications, loss functions are non-smooth or exhibit a very large smoothness constant $L$. + \item \textbf{Parameter Dependency:} The optimal setting for the parameter, $\tau = \frac{1}{Ld}$, is inversely proportional to both the smoothness constant $L$ and the dimension $d$. If $L$ is large, the resulting $\tau$ will be small. This makes the worst-case distribution very close to the original distribution, thereby limiting the robustness conferred by the method. +\end{enumerate} +Consequently, while the theoretical result is intriguing, the method's performance in empirical settings is often suboptimal due to the difficulty in satisfying these idealized conditions. +\end{remark} + + +\section{Additional Experiments} +\subsection{Classification under Data Imbalance} + + + +To further validate the findings in \ref{sec:circle-exp}, we conducted an experiment with an increased training set of 2000 samples while keeping all other settings unchanged. With a larger dataset, the decision boundaries of all methods are expected to converge toward the true circular boundary. In this high-data regime, WGF, Dual, and WRM learn similar boundaries that are nearly circular but still exhibit noticeable deviations. WFR, however, learns a tight and circular boundary, demonstrating its consistent superior performance (see Figure~\ref{fig:circle_2000}). +\begin{figure}[h] + \centering + \includegraphics[width=0.45\linewidth]{2000.pdf} + \caption{Decision boundaries on the Biased Circle dataset with 2000 training samples. WFR still learns a more accurate circular boundary compared to other methods.} + \label{fig:circle_2000} +\end{figure} + + + + + + + + + + + + + +\subsection{Uncertain Least Square} +We evaluate our methods on a distributionally robust least squares problem, following the setup from \citep{zhu2021kernel}, which was adapted from \citep{el1997robust}. The objective is to find a parameter vector $\theta \in \mathbb{R}^{10}$ that minimizes the loss $f_{\theta}(\xi) = \|A(\xi)\theta - b\|_2^2$, where the system matrix $A(\xi)$ is subject to uncertainty. The matrix $A(\xi) = A_0 + \xi A_1 \in \mathbb{R}^{10 \times 10}$ is an affine function of an uncertain scalar parameter $\xi \in [-1, 1]$. The matrices $A_0, A_1$ and the vector $b$ are fixed, with entries drawn independently from a standard normal distribution $\mathcal{N}(0, 1)$. + +\begin{figure}[h!] + \centering + \includegraphics[scale=0.6]{uncertain_least_squares_results.pdf} + \caption{Test loss as a function of the perturbation level $\Delta$ for the uncertain least squares problem. All methods were trained for 10 epochs with $\lambda=0.1$. For methods with an inner loop, the step size was $0.0001$ for $3000$ iterations. SDRO-based methods used $\epsilon=0.1$. WGF and WFR used $m=8$ particles.} + \label{fig:uls_results} +\end{figure} +The training set comprises $N=10$ samples $\{\xi_i\}_{i=1}^{N}$ drawn uniformly from $[-0.5, 0.5]$. To evaluate robustness, test samples are drawn from a shifted distribution, specifically uniform on $[-0.5(1+\Delta), 0.5(1+\Delta)]$. We vary the shift magnitude $\Delta$ from $0$ to $10$, where a larger $\Delta$ signifies a greater departure from the training distribution. + + + +Figure~\ref{fig:uls_results} shows the test loss as a function of the perturbation level $\Delta$. All distributionally robust methods maintain a significantly lower test loss than the empirical risk minimization baseline, demonstrating their robustness to distributional shifts. At low perturbation levels, all robust methods perform comparably. As $\Delta$ increases, the performance of the dual method degrades more rapidly than the others. WFR shows a marginal improvement over WGF and WRM. This limited advantage is attributable to the one-dimensional nature of the inner problem, which constrains worst-case samples to be either -1 or 1, thus minimizing the differences between the generated adversarial distributions. + + + + + + +\bibliographystyle{apalike} +\bibliography{Bibliography} + + + + + + +\end{document} diff --git a/source_v1/preamble-JZ.sty b/source_v1/preamble-JZ.sty new file mode 100644 index 0000000000000000000000000000000000000000..9a2907518a945d24d17be2632ba351a9187100bb --- /dev/null +++ b/source_v1/preamble-JZ.sty @@ -0,0 +1,298 @@ +% from JZ's style + +% ---------------------------------- +% JZ's hide-show routine +% I moved it to the main tex file so vscode can autocomplete it +% ---------------------------------- +% for generally hiding some texts with a toggle on or off: +\usepackage{comment} + +% Define the CUT environment +\newenvironment{CUT}{}{} + +% Command to toggle the CUT environment +\newcommand{\toggleCUT}[1]{% + \if#1t% + \renewenvironment{CUT}{\color{gray}}{\color{black}}% + \else% + \excludecomment{CUT}% + \fi% +} + + +% Set the initial state (t to show, f to hide) +\toggleCUT{t} +\toggleCUT{f} + +% Required package for colors +\RequirePackage{xcolor} + + % Place this in the preamble of your document + + +% Required packages for mathbb and other math symbols +% \RequirePackage{amssymb} +% \RequirePackage{amsmath} +% \RequirePackage{amsthm} + +% % Theorem environments +% \theoremstyle{definition} +% \newtheorem{theorem}{Theorem} +% \newtheorem{lemma}{Lemma} +\newtheorem{proposition}{Proposition} +% \newtheorem{corollary}{Corollary} +% \newtheorem{remark}{Remark} +\newtheorem{example}{Example} + +\usepackage{enumitem} % for tighter itemize +\newenvironment{tightenum}{ + \begin{enumerate}[itemsep=0pt, parsep=0pt, topsep=0pt, partopsep=0pt] +}{ + \end{enumerate} +} + +\newenvironment{tightitem}{ + \begin{itemize}[itemsep=0pt, parsep=0pt, topsep=0pt, partopsep=0pt] +}{ + \end{itemize} +} + +% \newcommand{\jz}[1]{\text{\color{red}\textbf{JZ: }#1}} + +%%shorthand%% +\newcommand{\dFdmu}{\frac{\delta F}{\delta \mu}\left[\mu\right]} +\newcommand{\dFdrho}{\frac{\delta F}{\delta \rho}\left[\rho\right]} +\newcommand{\dFdmuk}{\frac{\delta F}{\delta \mu}\left[\mu^k\right]} % first var evaluted at k step; explicit +\DeclareMathOperator*{\argmin}{argmin} +\DeclareMathOperator*{\argmax}{argmax} +\DeclareMathOperator*{\arginf}{arginf} +\DeclareMathOperator*{\argsup}{argsup} +% \DeclareMathOperator{\mmd}{MMD} +\newcommand{\dd}{\ \mathrm{d}} +% \newcommand{\rkhs}{\mathcal{H}} +\newcommand{\hiprod}[2]{\langle {#1, #2} \rangle _{\mathcal H}} %%RKHS inner product%% +\newcommand{\iprod}[2]{\langle {#1, #2} \rangle } +% \newcommand{\K}{\mathcal{K}} %%often used as integral operator%% +\newcommand{\E}{\mathbb{E}} %%exp operator%% +\newcommand{\R}{\mathbb{R}} +\newcommand{\DIV}{\mathrm{div}\,} +\newcommand{\const}{\mathrm{const.}} +\newcommand{\eviL}{(EVI)$_\lambda$} + +%%transport problem shorthand%% +% \newcommand{\ET}{\mathsf{E\kern-1pt T}} +% \newcommand{\MET}{\mathsf{M\kern-1pt E\kern-1pt T}} +% \newcommand{\IPT}{\mathsf{I\kern-1pt P\kern-1pt T}} +% \newcommand{\MIPT}{\mathsf{M\kern-1pt I\kern-1pt P\kern-1pt T}} +% \newcommand{\EIPT}{\mathsf{E\kern-1pt I\kern-1pt P\kern-1pt T}} +% \newcommand{\WFR}{\mathsf{W\kern-1pt F\kern-1pt R}} + +%%missing commands in markdown%% +\newcommand{\bm}[1]{\boldsymbol{\mathbf{#1}}} + +%%shorthand dissipation potential%% +% \newcommand{\Rk}{\mathcal R_k} %%dissipation of MMD potentail%% +\newcommand{\Kotto}{\mathbb{K}_\text{Otto}} %%Otto operator for diffusion%% +\newcommand{\Mplus}{\mathcal{M}^+} %%nonneg measure%% + +%%wgf jargon%% +\newcommand{\mslope}{|\nabla^- F|} % metric slope +\newcommand{\mder}{|\mu'|} % metric derivative + +%%sum notation%% +\newcommand{\sumiN}{\frac{1}{N}\sum_{i=1}^N} +\newcommand{\sumijMN}{\frac{1}{MN}\sum_{i=1}^M\sum_{j=1}^N} +\newcommand{\sumijNN}{\frac{1}{MN}\sum_{i=1}^N\sum_{j=1}^N} +\newcommand{\sumijMM}{\frac{1}{MM}\sum_{i=1}^M\sum_{j=1}^M} +% \newcommand{\sumijMNUnbiased}{\frac{1}{MN}\sum_{i=1}^M\sum_{j=1, j\neq i}^N} +\newcommand{\sumijNNUnbiased}{\frac{1}{N(N-1)}\sum_{i=1}^N\sum_{j=1, j\neq i}^N} +\newcommand{\sumijMMUnbiased}{\frac{1}{M(M-1)}\sum_{i=1}^M\sum_{j=1, j\neq i}^M} + +%%semi transparent%% +\newcommand{\semitransp}[2][35]{\textcolor{fg!#1}{#2}} + +%%colored text%% +\newcommand{\redA}{{\color{red}\alpha}} +\newcommand{\blueB}{{\color{blue}\beta}} + +\newcommand{\DF}{\mathrm{D} F} % differential of F + + +%% KL divergence and NGD %% +\newcommand{\mul}{\mu_\lambda} +\newcommand{\mulk}{\mu_{\lambda^k}} +\newcommand{\KL}{\operatorname{KL}} + + +%% acronym for distances %% +\newcommand{\ET}{\mathsf{E\kern-1pt T}} +\newcommand{\MET}{\mathsf{M\kern-1pt E\kern-1pt T}} +\newcommand{\IPT}{\mathsf{I\kern-1pt P\kern-1pt T}} +\newcommand{\IMT}{\mathsf{I\kern-1pt M\kern-1pt T}} +\newcommand{\MIPT}{\mathsf{M\kern-1pt I\kern-1pt P\kern-1pt T}} +\newcommand{\EIPT}{\mathsf{E\kern-1pt I\kern-1pt P\kern-1pt T}} +\newcommand{\WFR}{\mathsf{W\kern-1pt F\kern-1pt R}} +\newcommand{\FR}{\mathsf{F\kern-1pt R}} +\newcommand{\He}{\mathsf{He}} +% \newcommand{\KFR}{\mathsf{K\kern-1pt{-}\kern-1pt F\kern-1pt R}} +\newcommand{\FRk}{\mathsf{F\kern-1pt R}_k} +\newcommand{\supp}[1]{\operatorname{supp}(#1)} + +\DeclareMathOperator{\mmd}{MMD} +\DeclareMathOperator{\MMD}{MMD} +\DeclareMathOperator{\ksd}{KSD} +\DeclareMathOperator{\KSD}{KSD} + +\newcommand{\wtwostein}{\ensuremath{W_2}-Stein\xspace} + +\newcommand{\Lstein}{\ensuremath{\lambda}\text{-Stein}\xspace} + +% \newcommand{\wtwosteinLm}{\ensuremath{W_2^\lambda}-Stein\xspace} + +% \newcommand{\fstein}{F-Stein\xspace} + +\DeclareMathOperator{\ipm}{IPM} + +\DeclareMathOperator{\imm}{IMM} + +\newcommand{\rkhs}{\mathcal{H}} + +\newcommand{\K}{\mathcal{K}} %%often used as integral operator%% + +\newcommand{\Tk}{\mathcal{T}_k} %%often used as (L2->H) integral operator%% + +\newcommand{\Tkrho}{\mathcal{T}_{k,\rho}} %%often used as (L2->H) integral operator%% + +\newcommand{\Tkmu}{\mathcal{T}_{k,\mu}} %%often used as (L2->H) integral operator%% + +% \newcommand{\DF}{\mathrm{D} F} % differential of F + +% \newcommand{\Mplus}{\mathcal{M}^+} %%nonneg measure%% + +% \newcommand{\Rk}{\mathcal R_k} %%dissipation of MMD potentail%% + +% \newcommand{\RfrMMD}{\mathcal R_\mathrm{FR-MMD}} %%dissipation of MMD potentail%% regularized + +% \newcommand{\Kotto}{\mathbb{K}_\mathrm{Otto}} %%Otto operator for diffusion%% + +\newcommand{\ID}{\operatorname{Id}} %%Identify operator + +\newcommand{\Loj}{\L{}ojasiewicz\xspace} + + +%% short hand %% + +\newcommand{\Pth}{{P_\theta}} % parameterized distribution + +%% Alex's notation %% + +% Blackboardbold +\def\bbA{{\mathbb A}} \def\bbB{{\mathbb B}} \def\bbC{{\mathbb C}} +\def\bbD{{\mathbb D}} \def\bbE{{\mathbb E}} \def\bbF{{\mathbb F}} +\def\bbG{{\mathbb G}} \def\bbH{{\mathbb H}} \def\bbI{{\mathbb I}} +\def\bbJ{{\mathbb J}} \def\bbK{{\mathbb K}} \def\bbL{{\mathbb L}} +\def\bbM{{\mathbb M}} \def\bbN{{\mathbb N}} \def\bbO{{\mathbb O}} +\def\bbP{{\mathbb P}} \def\bbQ{{\mathbb Q}} \def\bbR{{\mathbb R}} +\def\bbS{{\mathbb S}} \def\bbT{{\mathbb T}} \def\bbU{{\mathbb U}} +\def\bbV{{\mathbb V}} \def\bbW{{\mathbb W}} \def\bbX{{\mathbb X}} +\def\bbY{{\mathbb Y}} \def\bbZ{{\mathbb Z}} +% Kalligraphische +\def\calA{{\mathcal A}} \def\calB{{\mathcal B}} \def\calC{{\mathcal C}} +\def\calD{{\mathcal D}} \def\calE{{\mathcal E}} \def\calF{{\mathcal F}} +\def\calG{{\mathcal G}} \def\calH{{\mathcal H}} \def\calI{{\mathcal I}} +\def\calJ{{\mathcal J}} \def\calK{{\mathcal K}} \def\calL{{\mathcal L}} +\def\calM{{\mathcal M}} \def\calN{{\mathcal N}} \def\calO{{\mathcal O}} +\def\calP{{\mathcal P}} \def\calQ{{\mathcal Q}} \def\calR{{\mathcal R}} +\def\calS{{\mathcal S}} \def\calT{{\mathcal T}} \def\calU{{\mathcal U}} +\def\calV{{\mathcal V}} \def\calW{{\mathcal W}} \def\calX{{\mathcal X}} +\def\calY{{\mathcal Y}} \def\calZ{{\mathcal Z}} + +%% alex notation for e, etc. %% +\def\d{\mathrm d} + +\def\dd{\;\!\mathrm{d}} % differential for integration + +\def\ee{\mathrm{e}} % Euler's number + +\def\ii{\mathrm{i}} % imaginary unit + + +%% alex special fonts %% +% Blackboardbold +\def\bbA{{\mathbb A}} \def\bbB{{\mathbb B}} \def\bbC{{\mathbb C}} +\def\bbD{{\mathbb D}} \def\bbE{{\mathbb E}} \def\bbF{{\mathbb F}} +\def\bbG{{\mathbb G}} \def\bbH{{\mathbb H}} \def\bbI{{\mathbb I}} +\def\bbJ{{\mathbb J}} \def\bbK{{\mathbb K}} \def\bbL{{\mathbb L}} +\def\bbM{{\mathbb M}} \def\bbN{{\mathbb N}} \def\bbO{{\mathbb O}} +\def\bbP{{\mathbb P}} \def\bbQ{{\mathbb Q}} \def\bbR{{\mathbb R}} +\def\bbS{{\mathbb S}} \def\bbT{{\mathbb T}} \def\bbU{{\mathbb U}} +\def\bbV{{\mathbb V}} \def\bbW{{\mathbb W}} \def\bbX{{\mathbb X}} +\def\bbY{{\mathbb Y}} \def\bbZ{{\mathbb Z}} +% Kalligraphische +\def\calA{{\mathcal A}} \def\calB{{\mathcal B}} \def\calC{{\mathcal C}} +\def\calD{{\mathcal D}} \def\calE{{\mathcal E}} \def\calF{{\mathcal F}} +\def\calG{{\mathcal G}} \def\calH{{\mathcal H}} \def\calI{{\mathcal I}} +\def\calJ{{\mathcal J}} \def\calK{{\mathcal K}} \def\calL{{\mathcal L}} +\def\calM{{\mathcal M}} \def\calN{{\mathcal N}} \def\calO{{\mathcal O}} +\def\calP{{\mathcal P}} \def\calQ{{\mathcal Q}} \def\calR{{\mathcal R}} +\def\calS{{\mathcal S}} \def\calT{{\mathcal T}} \def\calU{{\mathcal U}} +\def\calV{{\mathcal V}} \def\calW{{\mathcal W}} \def\calX{{\mathcal X}} +\def\calY{{\mathcal Y}} \def\calZ{{\mathcal Z}} +% mathromam +\def\rma{{\mathrm a}} \def\rmb{{\mathrm b}} \def\rmc{{\mathrm c}} +\def\rmd{{\mathrm d}} \def\rme{{\mathrm e}} \def\rmf{{\mathrm f}} +\def\rmg{{\mathrm g}} \def\rmh{{\mathrm h}} \def\rmi{{\mathrm i}} +\def\rmj{{\mathrm j}} \def\rmk{{\mathrm k}} \def\rml{{\mathrm l}} +\def\rmm{{\mathrm m}} \def\rmn{{\mathrm n}} \def\rmo{{\mathrm o}} +\def\rmp{{\mathrm p}} \def\rmq{{\mathrm q}} \def\rmr{{\mathrm r}} +\def\rms{{\mathrm s}} \def\rmt{{\mathrm t}} \def\rmu{{\mathrm u}} +\def\rmv{{\mathrm v}} \def\rmw{{\mathrm w}} \def\rmx{{\mathrm x}} +\def\rmy{{\mathrm y}} \def\rmz{{\mathrm z}} +\def\rmA{{\mathrm A}} \def\rmB{{\mathrm B}} \def\rmC{{\mathrm C}} +\def\rmD{{\mathrm D}} \def\rmE{{\mathrm E}} \def\rmF{{\mathrm F}} +\def\rmG{{\mathrm G}} \def\rmH{{\mathrm H}} \def\rmI{{\mathrm I}} +\def\rmJ{{\mathrm J}} \def\rmK{{\mathrm K}} \def\rmL{{\mathrm L}} +\def\rmM{{\mathrm M}} \def\rmN{{\mathrm N}} \def\rmO{{\mathrm O}} +\def\rmP{{\mathrm P}} \def\rmQ{{\mathrm Q}} \def\rmR{{\mathrm R}} +\def\rmS{{\mathrm S}} \def\rmT{{\mathrm T}} \def\rmU{{\mathrm U}} +\def\rmV{{\mathrm V}} \def\rmW{{\mathrm W}} \def\rmX{{\mathrm X}} +\def\rmY{{\mathrm Y}} \def\rmZ{{\mathrm Z}} +% fette math +\def\FG{\mathbf} +\def\mdot{\FG{:}} \def\vdot{\FG{\cdot}} +\def\bfa{{\FG a}} \def\bfb{{\FG b}} \def\bfc{{\FG c}} +\def\bfd{{\FG d}} \def\bfe{{\FG e}} \def\bff{{\FG f}} +\def\bfg{{\FG g}} \def\bfh{{\FG h}} \def\bfi{{\FG i}} +\def\bfj{{\FG j}} \def\bfk{{\FG k}} \def\bfl{{\FG l}} +\def\bfm{{\FG m}} \def\bfn{{\FG n}} \def\bfo{{\FG o}} +\def\bfp{{\FG p}} \def\bfq{{\FG q}} \def\bfr{{\FG r}} +\def\bfs{{\FG s}} \def\bft{{\FG t}} \def\bfu{{\FG u}} +\def\bfv{{\FG v}} \def\bfw{{\FG w}} \def\bfx{{\FG x}} +\def\bfy{{\FG y}} \def\bfz{{\FG z}} +\def\bfA{{\FG A}} \def\bfB{{\FG B}} \def\bfC{{\FG C}} +\def\bfD{{\FG D}} \def\bfE{{\FG E}} \def\bfF{{\FG F}} +\def\bfG{{\FG G}} \def\bfH{{\FG H}} \def\bfI{{\FG I}} +\def\bfJ{{\FG J}} \def\bfK{{\FG K}} \def\bfL{{\FG L}} +\def\bfM{{\FG M}} \def\bfN{{\FG N}} \def\bfO{{\FG O}} +\def\bfP{{\FG P}} \def\bfQ{{\FG Q}} \def\bfR{{\FG R}} +\def\bfS{{\FG S}} \def\bfT{{\FG T}} \def\bfU{{\FG U}} +\def\bfV{{\FG V}} \def\bfW{{\FG W}} \def\bfX{{\FG X}} +\def\bfY{{\FG Y}} \def\bfZ{{\FG Z}} +\def\BS{\boldsymbol} % griechisch +\def\bfalpha{{\BS\alpha}} \def\bfbeta{{\BS\beta}} +\def\bfgamma{{\BS\gamma}} \def\bfdelta{{\BS\delta}} +\def\bfepsilon{{\BS\varepsilon}} \def\bfzeta{{\BS\zeta}} +\def\bfeta{{\BS\eta}} \def\bftheta{{\BS\theta}} +\def\bfiota{{\BS\iota}} \def\bfkappa{{\BS\kappa}} +\def\bflambda{{\BS\lambda}} \def\bfmu{{\BS\mu}} +\def\bfnu{{\BS\nu}} \def\bfxi{{\BS\xi}} +\def\bfpi{{\BS\pi}} \def\bfrho{{\BS\rho}} +\def\bfsigma{{\BS\sigma}} \def\bftau{{\BS\tau}} +\def\bfphi{{\BS\phi}} \def\bfchi{{\BS\chi}} +\def\bfpsi{{\BS\psi}} \def\bfomega{{\BS\omega}} +\def\bfvarphi{{\BS\varphi}} +\def\bfGamma{{\BS\Gamma}} \def\bfDelta{{\BS\Delta}} +\def\bfTheta{{\BS\Theta}} \def\bfLambda{{\BS\Lambda}} +\def\bfXi{{\BS\Xi}} \def\bfPi{{\BS\Pi}} +\def\bfSigma{{\BS\Sigma}} \def\bfPhi{{\BS\Phi}} +\def\bfPsi{{\BS\Psi}} \def\bfOmega{{\BS\Omega}} \ No newline at end of file diff --git a/source_v1/rgo_frame.pdf b/source_v1/rgo_frame.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ab573733f63cc1853e8f8f87475018ca415a510a Binary files /dev/null and b/source_v1/rgo_frame.pdf differ diff --git a/source_v1/rgo_lam=10_eps=0.002.pdf b/source_v1/rgo_lam=10_eps=0.002.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fa1d25664f9972d2165b92054be4bfcc8adbc2dd Binary files /dev/null and b/source_v1/rgo_lam=10_eps=0.002.pdf differ diff --git a/source_v1/rgo_lam=10_eps=0.02.pdf b/source_v1/rgo_lam=10_eps=0.02.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f42743659e336aafa2b0ce6cf0ac38fa1f9b18d6 Binary files /dev/null and b/source_v1/rgo_lam=10_eps=0.02.pdf differ diff --git a/source_v1/rgo_lam=10_eps=0.2.pdf b/source_v1/rgo_lam=10_eps=0.2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6345403de0d9c6238a08aead1e2ab31b0a49ad3c Binary files /dev/null and b/source_v1/rgo_lam=10_eps=0.2.pdf differ diff --git a/source_v1/saa_perturb_objective_comparison.pdf b/source_v1/saa_perturb_objective_comparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..55142a83de56e84142311482581afc5e19ed9111 Binary files /dev/null and b/source_v1/saa_perturb_objective_comparison.pdf differ diff --git a/source_v1/svg_frame_0.1.pdf b/source_v1/svg_frame_0.1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b75bc0290807d699daca04fcc2a905278c8380b7 Binary files /dev/null and b/source_v1/svg_frame_0.1.pdf differ diff --git a/source_v1/svg_frame_0.2.pdf b/source_v1/svg_frame_0.2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9c81263d18dd38a5a41f3a5fb12987804d0f31b3 Binary files /dev/null and b/source_v1/svg_frame_0.2.pdf differ diff --git a/source_v1/uncertain_least_squares_results.pdf b/source_v1/uncertain_least_squares_results.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fe9df6e95cb5bc9e82682215096e0f5db0bfe6b7 Binary files /dev/null and b/source_v1/uncertain_least_squares_results.pdf differ diff --git a/source_v1/wfr_frame.pdf b/source_v1/wfr_frame.pdf new file mode 100644 index 0000000000000000000000000000000000000000..02ece6fa44206fb103bbe9ef9f4f0bb511504fd5 --- /dev/null +++ b/source_v1/wfr_frame.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d1935af30b285970385eca6ad62348ec3b7435b8c02f14901bf561d3792cbe7 +size 260811 diff --git a/source_v1/wgf_frame.pdf b/source_v1/wgf_frame.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aa08fff6c39e4e0ae176e057fa01853fe9f9ecd0 Binary files /dev/null and b/source_v1/wgf_frame.pdf differ diff --git a/source_v1/wrm_frame.pdf b/source_v1/wrm_frame.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c2513a5e36cdfffa73236aaa1f5b7484a1deba5b Binary files /dev/null and b/source_v1/wrm_frame.pdf differ diff --git a/style.css b/style.css deleted file mode 100644 index 114adf441e9032febb46bc056b2a8bb651075f0d..0000000000000000000000000000000000000000 --- a/style.css +++ /dev/null @@ -1,28 +0,0 @@ -body { - padding: 2rem; - font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif; -} - -h1 { - font-size: 16px; - margin-top: 0; -} - -p { - color: rgb(107, 114, 128); - font-size: 15px; - margin-bottom: 10px; - margin-top: 5px; -} - -.card { - max-width: 620px; - margin: 0 auto; - padding: 16px; - border: 1px solid lightgray; - border-radius: 16px; -} - -.card p:last-child { - margin-bottom: 0; -} diff --git a/trackio-logo-light.png b/trackio-logo-light.png new file mode 100644 index 0000000000000000000000000000000000000000..b3438262c61989e6c6d16df4801a8935136115b3 Binary files /dev/null and b/trackio-logo-light.png differ diff --git a/trackio-logo.png b/trackio-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e6ff7e0a3580bca040d9ec3ea8c91e8cca469e61 Binary files /dev/null and b/trackio-logo.png differ diff --git a/trackio-wordmark-dark.png b/trackio-wordmark-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..2495f610c975917290b57706133b38621a58cb8b Binary files /dev/null and b/trackio-wordmark-dark.png differ