SPB Git

spb/wp28_uqo

Public
1.5 KB · 16 lines python
1#!/usr/bin/env python32"""Figure: sufficient exponents alpha(r,q) (exact curvature) and the stale / single-machine variants (Theorems 1 and 3)."""3import sys, pathlib4import matplotlib; matplotlib.use("Agg"); import matplotlib.pyplot as plt5sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1] / "experiments")); from process_results import _setup, PAL, INK2, FIG6sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1] / "src")); from pamle.communication import sufficient_exponent, sufficient_exponent_stale, sufficient_exponent_single7_setup(); fig, axes = plt.subplots(1, 3, figsize=(8.4, 2.8), sharey=True)8rs = [1, 2, 3, 4]; cols = ["blue", "orange", "aqua", "violet"]; mks = ["o", "s", "^", "D"]9for ax, (fn, title) in zip(axes, [(sufficient_exponent, "exact aggregated curvature"), (sufficient_exponent_stale, "stale averaged local curvature"), (sufficient_exponent_single, "single-machine curvature")]):10    for q, c, mk in zip(range(4), cols, mks):11        ax.plot(rs, [fn(r, q) for r in rs], marker=mk, color=PAL[c], label=f"q = {q}", markerfacecolor="white", markeredgewidth=1.2)12    ax.set_xticks(rs); ax.set_xlabel("local order r"); ax.set_title(title, fontsize=8, loc="left"); ax.set_ylim(0.45, 1.0)13    ax.axhline(0.5, color=INK2, lw=0.6, ls=":"); 14axes[0].set_ylabel("sufficient exponent α in K = o(N^α)"); axes[0].legend(fontsize=7, loc="lower right")15FIG.mkdir(parents=True, exist_ok=True); fig.savefig(FIG / "fig_exponents.pdf"); print("ok")16
Files · 7b15181efaaeded079fc4c371a236873d8fe6b3d
Menu

Theme