class_docstr: Controller class for optimization.
  
  Mostly a thin wrapper for `optim`, but also useful for implementing learning rate
  scheduling beyond what is currently available. Also implements necessary methods for
  training RNNs such as grad manipulations.
  
  Args:
      method (string):
          One of [sgd, adagrad, adadelta, adam].
      lr (float):
          Learning rate.
      lr_decay (float):
          Learning rate decay multiplier.
      start_decay_at (int):
          Epoch to start learning rate decay. If None, starts decay when the validation
          accuracy stops improving. Defaults to 1.
      beta1, beta2 (float):
          Hyperarameters for adam.
      adagrad_accum (float, optional):
          Initialization hyperparameter for adagrad.
class_docstr_tok: ["Controller","class","for","optimization",".","Mostly","a","thin","wrapper","for","`","optim","`",",","but","also","useful","for","implementing","learning","rate","scheduling","beyond","what","is","currently","available",".","Also","implements","necessary","methods","for","training","RNNs","such","as","grad","manipulations",".","Args",":","method","(","string",")",":","One","of","[","sgd",",","adagrad",",","adadelta",",","adam","]",".","lr","(","float",")",":","Learning","rate",".","lr_decay","(","float",")",":","Learning","rate","decay","multiplier",".","start_decay_at","(","int",")",":","Epoch","to","start","learning","rate","decay",".","If","None",",","starts","decay","when","the","validation","accuracy","stops","improving",".","Defaults","to","1.","beta1",",","beta2","(","float",")",":","Hyperarameters","for","adam",".","adagrad_accum","(","float",",","optional",")",":","Initialization","hyperparameter","for","adagrad","."]
docstr: Update the model parameters based on current gradients.
  
  Optionally, will employ gradient clipping.
docstr_tok: ["Update","the","model","parameters","based","on","current","gradients",".","Optionally",",","will","employ","gradient","clipping","."]
code: def step(self):
      """Update the model parameters based on current gradients.
  
      Optionally, will employ gradient clipping.
      """
      self._step += 1
  
      if self.max_grad_norm:
          clip_grad_norm_(self.params, self.max_grad_norm)
      self.base_optimizer.step()
  
file_path: deepmatcher/deepmatcher/optim.py
imports: import logging
  import torch
  import torch.nn
  import torch.optim
  from torch.autograd import Variable
  from torch.nn.utils import clip_grad_norm_
label_desc: Use image node_id 4 for calling the Optimizer obj's underlying member method code with example usage: obj.step() without return types