netket_foundation.stats.ReplicaStats#

class netket_foundation.stats.ReplicaStats[source]#

Bases: Stats

A batched netket.stats.Stats: one entry per replica.

Every field carries a leading (n_replicas,) axis, so this is a genuine pytree of batched arrays (built by replica_statistics() via jax.vmap) rather than a Python list.

It still behaves like the old list[Stats]: len(rs) is the number of replicas, rs[i] and iteration yield the scalar Stats of one replica (in replica order). The aggregate training-loss summary is exposed under total.

Attributes
shape[source]#

Shape of the batch — (n_replicas,).

total[source]#

Aggregate the per-replica statistics into a single summary.

The combination rule used for the foundational training loss:

  • mean: average of the replica means,

  • error_of_mean: quadrature sum of the replica errors divided by the number of replicas (standard error of the grand mean),

  • variance: average of the replica variances,

  • tau_corr: average of the replica autocorrelation times,

  • R_hat: maximum across replicas (the most conservative convergence indicator),

  • tau_corr_max: maximum across replicas (the most conservative autocorrelation-time estimate).

Methods
imag()[source]#
real()[source]#
replace(**updates)[source]#

Returns a new object replacing the specified fields with new values.

classmethod stack(stats)[source]#

Build a ReplicaStats by stacking scalar Stats.

Used for the online-statistics path, which produces one Stats per replica that cannot be obtained via vmap.

Return type:

ReplicaStats

Parameters:

stats (Sequence[Stats])

to_compound()[source]#
to_dict()[source]#