Created
February 21, 2019 17:58
-
-
Save ayoubbenaissa/5efa8a7dc8a66d3897ffd26658f315f0 to your computer and use it in GitHub Desktop.
pytorch tuto
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
#create class: | |
class LinearRegressionModel (nn.Module): | |
def __init__(self, input_size, output_size): | |
super(LinearRegressionModel, self).__init__() | |
self.linear = nn.Linear(1, 1) | |
def forward(self, x): | |
out = self.linear(x) | |
return out | |
#create object (instance from the class) | |
model = LinearRegressionModel(1, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment