aitech-eks-pub/wyk/pytorch_regression/my_linear_regressor2.py

11 lines
252 B
Python
Raw Normal View History

2021-05-05 13:35:25 +02:00
import torch.nn as nn
class MyLinearRegressor2(nn.Module):
def __init__(self, vlen):
super(MyLinearRegressor2, self).__init__()
self.w = nn.Linear(vlen, 1, bias=False)
def forward(self, x):
return self.w(x).squeeze()