narla.history

History

class narla.history.History(storage_size=10000)[source]

Bases: object

History object contains arbitrary data from training

Parameters

storage_size (int) – Max storage size

clear()[source]

Clear History

get(key, stack=False)[source]

Access an element from the History

Parameters
  • key (str) – Name of element to Access

  • stack (bool) – If True will stack the values into a Tensor

Return type

list | torch.Tensor

record(**kwargs)[source]

Store all the keyword arguments

Parameters

kwargs – If the key word doesn’t yet exist an internal list will be created and the value appended to it

sample(names, sample_size, from_most_recent=10000)[source]
Return type

List[List[Tensor]]

stack(*keys, dim=- 1)[source]

Stack a series of Tensors

Parameters
  • keys – Keys of the values to access from the History

  • dim (int) – Dimension of the Tensors to stack on

Return type

Tensor

to_data_frame(keys=())[source]

Convert a History object to a DataFrame

Parameters

keys (List[str]) – Keys to use as columns in the DataFrame

Return type

DataFrame