tn_noise_learning.history#
Per-epoch training record.
History
dataclass
#
History(
metrics: dict[str, list[float]] = dict(),
params: list[list[ndarray]] = list(),
best_epoch: int | None = None,
num_sites: int | None = None,
)
Metric curves and optional parameter snapshots recorded by Trainer.
| PARAMETER | DESCRIPTION |
|---|---|
metrics
|
one list per metric name, one value per epoch. |
params
|
Kraus tensors after each epoch, filled only when |
best_epoch
|
1-based epoch whose parameters were written back to the model.
TYPE:
|
num_sites
|
number of qubits, used to draw the trace-preserving reference
TYPE:
|
append #
append(
values: dict[str, Any],
tensors: list[ndarray] | None = None,
) -> None
Record one epoch.
Source code in src/tn_noise_learning/history.py
54 55 56 57 58 59 | |
load
classmethod
#
load(path: str | Path) -> History
Read a history written by save.
Source code in src/tn_noise_learning/history.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
plot #
plot(path: str | Path | None = None) -> Figure
Plot the metric curves with plot_history.
Source code in src/tn_noise_learning/history.py
89 90 91 92 93 | |
save #
save(path: str | Path) -> None
Write to a zarr store at path.
Source code in src/tn_noise_learning/history.py
61 62 63 64 65 66 67 68 69 | |