netket.logging.RuntimeLog#

class netket.logging.RuntimeLog[source]#

Bases: AbstractLog

This logger accumulates log data in a set of nested dictionaries which are stored in memory. The log data is not automatically saved to the filesystem.

It can be passed with keyword argument out to Monte Carlo drivers in order to serialize the output data of the simulation.

This logger keeps the data in memory, and does not save it to disk. To serialize the current content to a file, use the method serialize().

Inheritance
Inheritance diagram of netket.logging.RuntimeLog
__init__()[source]#

Crates a Runtime Logger.

Attributes
data#

The dictionary of logged data.

Methods
__call__(step, item, variational_state=None)[source]#

Logs at a given integer step a dictionary of data, optionally specifying a variational state to encode additional data.

Parameters:
  • step – monotonically increasing integer representing the row in the database corresponding to this log entry;

  • item – Any dictionary of data to be logged;

  • variational_state – optional variational state from which additional data might be extracted.

flush(variational_state=None)[source]#

Flushes the data that is stored internally to disk/network.

Parameters:

variational_state – optional variational state from which additional data might be extracted.

serialize(path)[source]#

Serialize the content of data to a file.

If the file already exists, it is overwritten.

Parameters:

path (Union[str, Path, IO]) – The path of the output file. It must be a valid path.