#005 PyTorch - Logistic Regression in PyTorch - Master Data Science
The first step is to create a class called LogisticRegression(). We will pass torch. Then we will define a linear layer that will be the same as in the linear regression. So we will call the torch.nn.Linear() function. This function takes two input parameters. The first one is the size of each input sample which in this case will be equal to 2. The second parameter is the shape of the output which will be equal to 1. Next, we will create the forward() function which will take self and x as inputs.
Jan-31-2022, 20:33:41 GMT