Pytorch, Torch, Torchvision, Deep Learning, Python.
class. class model(): def __init__(self, x, y, b, w, eta): self.x = x self.y = y self.b = b self.w = w self.eta = eta def fit(self, w, x, b): return w * x + b def loss(self, w): pred = self.fit(w, self.x, self.b) sq = (pred - self.y) ** 2 return sq.mean() def out(self, lr): w1, w2 = self.update()