hopfield

class hopfield4py.Hopfield(N: int)
load(data: Tensor) None

Train number od memories. The number of memories is automatically inferred from data.shape[0]

Parameters:

data – tensor of shape (,Nspins) with data to train

reconstruct(corrupted: Tensor) Tensor

Reconstruct a memory

Parameters:

corrupted – Corrupted memory

train() None

set the weights