StateLog(output_prefix, mode='write', save_every=1, tar=False)¶
A logger which serializes the variables of the variational state during a run.
The data is saved either to a directory or tar archive in a sequence of files named [0.mpack, 1.mpack, …] where the filename is incremented every time the logger is called. The tar file inside is not flushed to disk (closed) until this object is deleted or python is shut down.
__init__(output_prefix, mode='write', save_every=1, tar=False)¶
str) – the name of the output file before the extension (if tar=True) or of the output folder.
int) – every how many iterations the variables should be saved. (default 1)
Specify the behaviour in case the file already exists at this output_prefix. Options are - [w]rite: (default) overwrites file/delete the folder if
it already exists;
[a]ppend: appends to the file/folder if it exists, overwise creates a new file;
[x] or fail: fails if file/folder already exists;
bool) – if True creates a tar archive instead of a folder.