Implement Linear Regression in PyTorch

Basicauto-graded

Build a linear regression model from scratch using PyTorch tensors and autograd, fitting a line to synthetic data with gradient descent.

Solve it

Check your answer

The grader verifies properties of your implementation, so a correct solution written differently from ours still passes.

pip install torchleet

from torchleet import check
check("lin-regression", LinearRegressionModel)