Model Types
Explore PyTorch model types by learning how to use nested models and sequential models in the context of a simple linear regression problem. Understand how parameters like weights and biases are managed within custom and built-in models, and how using Sequential simplifies model construction.
We'll cover the following...
Nested models
In our model, we manually created two parameters to perform a linear regression. Instead of defining individual parameters, what if we use PyTorch’s Linear model?
We are implementing a single feature linear regression, one input, and one output, so the corresponding linear model would look like this:
Do we still have our b and w parameters? Sure we do!
So, our former parameter b is the bias, and our former parameter w is the weight. Your values will be different since random seed has not been set up for this example. ...