netket.stats.online_statistics

netket.stats.online_statistics#

netket.stats.online_statistics(data, old_estimator=None, *, decay=None, max_lag=64)[source]#

Accumulate streaming MCMC statistics across batches.

This is the functional API for OnlineStats. Each call merges a new batch of data into the running estimator using the parallel Welford algorithm.

Parameters:
Return type:

OnlineStats | OnlineStatsBatch

Returns:

Updated OnlineStats or OnlineStatsBatch instance, depending on the input type.

Example:

estimator = None
for batch in training_loop:
    estimator = nk.stats.online_statistics(batch, estimator)
stats = estimator.get_stats()