human
I am working on the file "DL0110EN/2.4PyTorchway_v2.ipynb".
The first task is:
<!--Empty Space for separating topics-->

<h2 id="Model_Cost">Create the Model and Total Loss Function (Cost)</h2>

Create a linear regression class
Can you write Python program for it?

=====
What is a the Python program you requested?
assistant
#Here is the Python program you requested.

# Create a linear regression model class

from torch import nn, optim

class linear_regression(nn.Module):
    
    # Constructor
    def __init__(self, input_size, output_size):
        super(linear_regression, self).__init__()
        self.linear = nn.Linear(input_size, output_size)
        
    # Prediction
    def forward(self, x):
        yhat = self.linear(x)
        return yhat