OptimCheckpoint

Contents

OptimCheckpoint#

class liesel.optim.OptimCheckpoint(_carry, duration=0.0, versions=<factory>, _rebuild_model_state=False, _data_structure=())[source]#

Bases: object

An explicit snapshot from which an optimization run can continue.

Pass a result’s checkpoint to OptimEngine.fit. The snapshot retains optimizer and random state as well as the completed history; it does not retain an engine or loss callable. Treat snapshots as read-only. Mutable containers are independent of the result, but their immutable JAX arrays are shared. Continuing a snapshot does not mutate it or its original result.

Methods

load(path)

Loads a trusted checkpoint file onto the current JAX device.

save(path)

Atomically saves this snapshot, replacing an existing file.

Attributes

duration

Cumulative active optimization runtime in seconds.

history

History retained by this snapshot, sharing arrays with its result.

n_epochs

Number of completed epochs in this snapshot.

versions

Package versions recorded with the checkpoint.