Created
August 28, 2019 20:19
-
-
Save n0obcoder/2861411e662657a9d482cf445bf35e27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Defining the model architecture. | |
| class LinearRegressionModel(torch.nn.Module): | |
| def __init__(self): | |
| super(LinearRegressionModel, self).__init__() | |
| self.linear = torch.nn.Linear(1, 1) # this layer of the model has a single neuron, that takes in one scalar input and gives out one scalar output. | |
| def forward(self, x): | |
| y_pred = self.linear(x) | |
| return y_pred | |
| # Creating the model | |
| model = LinearRegressionModel() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment