def __init__(self, num_embeddings: int, embedding_dim: int) -> None: self.num_embeddings = num_embeddings self.embedding_dim = embedding_dim # jeden wektor o rozmiarze size embedding_dim dla każdego przekształcenia self.embeddings = random_tensor(num_embeddings, embedding_dim) self.grad = zeros_like(self.embeddings) # zapisz ostatni input id self.last_input_id = None
def __init__(self, num_embeddings: int, embedding_dim: int) -> None: self.num_embeddings = num_embeddings self.embedding_dim = embedding_dim # One vector of size embedding_dim for each desired embedding self.embeddings = random_tensor(num_embeddings, embedding_dim) self.grad = zeros_like(self.embeddings) # Save last input id self.last_input_id = None