Save and load all network tensors (actor, 2 critics, 2 target critics, alpha parameter, Adam optimizer states) as individual .npy tensors packed into a single .zip file via Nim's std/zipfiles.
Each tensor is a standard .npy inside the archive — individually inspectable by extracting. Atomic save: write to a temp file, then rename to the target path.
Checkpoint directory convention: weights/latest.zip for current state, periodic snapshots as weights/checkpoint_<N>.zip.
Acceptance criteria
save(path, networks) creates a valid .zip containing .npy entries for all tensors
load(path) → networks restores all tensors exactly (round-trip correctness)
File is a valid zip — can be extracted with standard tools and .npy files are readable by numpy
Atomic save: incomplete writes don't corrupt the checkpoint
## Parent
#37
## What to build
Save and load all network tensors (actor, 2 critics, 2 target critics, alpha parameter, Adam optimizer states) as individual `.npy` tensors packed into a single `.zip` file via Nim's `std/zipfiles`.
Each tensor is a standard `.npy` inside the archive — individually inspectable by extracting. Atomic save: write to a temp file, then rename to the target path.
Checkpoint directory convention: `weights/latest.zip` for current state, periodic snapshots as `weights/checkpoint_<N>.zip`.
## Acceptance criteria
- [ ] `save(path, networks)` creates a valid `.zip` containing `.npy` entries for all tensors
- [ ] `load(path) → networks` restores all tensors exactly (round-trip correctness)
- [ ] File is a valid zip — can be extracted with standard tools and `.npy` files are readable by numpy
- [ ] Atomic save: incomplete writes don't corrupt the checkpoint
- [ ] `test_weights.nim` passes
## Blocked by
- #38 (SAC_LSTM_Bot: project scaffold)
- #41 (LSTM network module)
Weight persistence module complete — zipped .npy via std/zipfiles, atomic save (temp+rename), checkpoint includes Adam states with optional load. 12/12 tests pass. Full suite 69+ tests all green. Code reviewed clean.
Weight persistence module complete — zipped .npy via std/zipfiles, atomic save (temp+rename), checkpoint includes Adam states with optional load. 12/12 tests pass. Full suite 69+ tests all green. Code reviewed clean.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent
#37
What to build
Save and load all network tensors (actor, 2 critics, 2 target critics, alpha parameter, Adam optimizer states) as individual
.npytensors packed into a single.zipfile via Nim'sstd/zipfiles.Each tensor is a standard
.npyinside the archive — individually inspectable by extracting. Atomic save: write to a temp file, then rename to the target path.Checkpoint directory convention:
weights/latest.zipfor current state, periodic snapshots asweights/checkpoint_<N>.zip.Acceptance criteria
save(path, networks)creates a valid.zipcontaining.npyentries for all tensorsload(path) → networksrestores all tensors exactly (round-trip correctness).npyfiles are readable by numpytest_weights.nimpassesBlocked by
Weight persistence module complete — zipped .npy via std/zipfiles, atomic save (temp+rename), checkpoint includes Adam states with optional load. 12/12 tests pass. Full suite 69+ tests all green. Code reviewed clean.