np.vander(x, d + 1, increasing=True)
np.linalg.lstsq
np.polyfit(x, y, d), np.polyval(koef, x)
koef[::-1]
RankWarning: Polyfit may be poorly conditioned
train_test_split(..., train_size=n, stratify=y)
random_state=0
torch.optim.Adam(params, lr=1e-3, weight_decay=0.0)
betas=(0.9, 0.999)
eps=1e-8
weight_decay
nn.Linear и копирование весов
nn.Linear(64, 512).weight
with torch.no_grad(): layer.weight.copy_(torch.tensor(W.T)); layer.bias.copy_(torch.tensor(b))
torch.set_default_dtype(torch.float64)
torch.tensor(y, dtype=torch.long)
copy.deepcopy(model.state_dict()) и load_state_dict
state_dict()
layer.weight.copy_(torch.tensor(W.T))
RuntimeError: expected scalar type Long
copy.deepcopy(...)
load_state_dict
Зачем при сверке PyTorch с NumPy вызывают torch.set_default_dtype(torch.float64)?