PyTorch · Class
optim.SGD
torch.optim.SGD updates parameters with stochastic gradient descent. It supports momentum, weight decay, Nesterov updates, objective maximization, and alternative implementations.
Last updated
Syntax
torch.optim.SGD(params, lr=0.001, momentum=0, dampening=0, weight_decay=0, nesterov=False, *, maximize=False, foreach=None, differentiable=False, fused=None)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
torch.optim.Optimizeradd_param_groupload_state_dicttorch.optim.sgd.sgd