An optimizer updates the model's parameters from the gradients. SGD applies a step proportional to the gradient, optionally with momentum; Adam adapts the step for each parameter. The learning rate (lr) is the key hyperparameter. step() applies the update.
Example
optimiseur = torch.optim.Adam(modele.parameters(), lr=1e-3)