aitech-eks-pub/wyk/pytorch_regression/my_linear_regressor2.py
2021-05-19 13:21:13 +02:00

11 lines
252 B
Python

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()