December 2018
Intermediate to advanced
158 pages
3h 58m
English
A simple logistic regression model does not look a great deal different from the model for linear regression. The following is a typical class definition for a logistic model:

Notice that we still use a linear function when we initialize the model class. However, for logistic regression, we need an activation function. Here, this is applied when forward is called. As usual, we instantiate the model into our model variable.
Next, we set the criterion and optimizer:

We still use stochastic gradient descent; however, we need ...
Read now
Unlock full access