Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save n0obcoder/8e2ffa641ce572d7ab3a901d654f3f1d to your computer and use it in GitHub Desktop.

Select an option

Save n0obcoder/8e2ffa641ce572d7ab3a901d654f3f1d to your computer and use it in GitHub Desktop.
# Defining the Loss Function
# Mean Squared Error is the most common choice of Loss Function for Linear Regression models.
criterion = torch.nn.MSELoss()
# Defining the Optimizer, which would update all the trainable parameters of the model, making the model learn the data distribution better and hence fit the distribution better.
optimizer = torch.optim.Adam(model.parameters(), lr = 0.0005)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment