class_docstr: AdaFactor pytorch implementation as introduced in `Adafactor: Adaptive Learning Rates with Sublinear Memory Cost`
  https://arxiv.org/abs/1804.04235.
  
  Args:
      params (Iterable[nn.parameter.Parameter]):
          Iterable of parameters to optimize or dictionaries defining parameter groups.
      lr (float, optional):
          The external learning rate.
      eps (Tuple[float, float], optional):
          Regularization constants for square gradient and parameter scale respectively.
      clip_threshold (float, optional):
          Threshold of root mean square of final gradient update.
      decay_rate (float, optional):
          Coefficient used to compute running averages of square.
      beta1 (float, optional):
          Coefficient used for computing running averages of gradient.
      weight_decay (float, optional):
          Weight decay (L2 penalty).
      scale_parameter (bool, optional):
          If True, learning rate is scaled by root mean square.
      relative_step (bool, optional):
          If True, time-dependent learning rate is computed instead of external learning rate.
      warmup_init (bool, optional):
          Time-dependent learning rate computation depends on whether warm-up initialization is being used.
class_docstr_tok: ["AdaFactor","pytorch","implementation","as","introduced","in","`","Adafactor",":","Adaptive","Learning","Rates","with","Sublinear","Memory","Cost","`","https",":","\/\/arxiv.org\/abs\/1804.04235",".","Args",":","params","(","Iterable","[","nn.parameter.Parameter","]",")",":","Iterable","of","parameters","to","optimize","or","dictionaries","defining","parameter","groups",".","lr","(","float",",","optional",")",":","The","external","learning","rate",".","eps","(","Tuple","[","float",",","float","]",",","optional",")",":","Regularization","constants","for","square","gradient","and","parameter","scale","respectively",".","clip_threshold","(","float",",","optional",")",":","Threshold","of","root","mean","square","of","final","gradient","update",".","decay_rate","(","float",",","optional",")",":","Coefficient","used","to","compute","running","averages","of","square",".","beta1","(","float",",","optional",")",":","Coefficient","used","for","computing","running","averages","of","gradient",".","weight_decay","(","float",",","optional",")",":","Weight","decay","(","L2","penalty",")",".","scale_parameter","(","bool",",","optional",")",":","If","True",",","learning","rate","is","scaled","by","root","mean","square",".","relative_step","(","bool",",","optional",")",":","If","True",",","time-dependent","learning","rate","is","computed","instead","of","external","learning","rate",".","warmup_init","(","bool",",","optional",")",":","Time-dependent","learning","rate","computation","depends","on","whether","warm-up","initialization","is","being","used","."]
code: def _get_options(param_group, param_shape):
      factored = len(param_shape) >= 2
      use_first_moment = param_group["beta1"] is not None
      return factored, use_first_moment
  
file_path: towhee/towhee/trainer/optimization/adafactor.py
imports: import torch
  import math
  from torch.optim import Optimizer
label_desc: Use image node_id 3 for calling the Adafactor obj's underlying member method code with example usage: obj._get_options(param_group, param_shape) and returns: factored,  use_first_moment