plot_re_acceptance

jaxrens.postprocess.plotting.plot_re_acceptance(monitor_or_trace, *, ax=None, per_pair=True, window=None, label_prefix='', **kwargs)[source]

Plot inter-replica swap acceptance rate vs iteration.

Per-fire per-pair acceptance comes from the RE trace (loaded from <prefix>.re_stats.h5). When per_pair=True (default), draws one line per adjacent replica pair. When per_pair=False, plots the mean across pairs with a shaded fill_between for ±1 std.

Per-fire values are 0/1 noisy for n_swap_cycles=1 runs. Pass window=W to apply a centred boxcar average of width W to each pair’s trace before plotting.

Parameters:
  • monitor_or_trace – A populated Monitor with a non-None re_trace or an RELog instance directly.

  • ax (Axes | None) – Existing axes to plot into. Created if None.

  • per_pair (bool) – If True, draw one line per adjacent replica pair. Otherwise plot mean ± std across pairs.

  • window (int | None) – Optional boxcar smoothing window length (in fire entries).

  • label_prefix (str) – Prefix prepended to the legend label when per_pair=False (used by the CLI plot dispatcher).

  • **kwargs – Forwarded to ax.plot.

Returns:

The Axes object.

Raises:

ValueError – If no RE trace can be resolved or it has zero pairs.

Return type:

Axes