Beispiel #1
0
 def __init__(self, model, optimizer_config):
     self.config = optimizer_config
     SGD.__init__(
         self,
         model.parameters(),
         lr=self.config.learning_rate,
         momentum=self.config.momentum,
     )
Beispiel #2
0
 def __init__(self,
              params,
              lr=required,
              momentum=0,
              dampening=0,
              weight_decay=0,
              nesterov=False,
              gpu_device=None):
     SGD.__init__(self,
                  params,
                  lr=lr,
                  momentum=momentum,
                  dampening=dampening,
                  weight_decay=weight_decay,
                  nesterov=nesterov)
     SharedOptimizerBase.__init__(self, gpu_device=gpu_device)