class_docstr: Optimizer/UpdateRule hook function for Lasso regularization.
  
  This hook function adds a scaled parameter to the sign of each weight.
  It can be used as a regularization.
  
  Args:
      rate (float): Coefficient for the weight decay.
  
  Attributes:
      ~optimizer_hooks.Lasso.rate (float): Coefficient for the weight decay.
      ~optimizer_hooks.Lasso.timing (string): Specifies
                       when this hook should be called by
                       the Optimizer/UpdateRule. Valid values are 'pre'
                       (before any updates) and 'post' (after any updates).
      ~optimizer_hooks.Lasso.call_for_each_param (bool): Specifies
                       if this hook is called for each parameter (``True``)
                       or only once (``False``) by an optimizer to
                       which this hook is registered. This function does
                       not expect users to switch the value from default one,
                       which is `True`.
  
  .. versionadded:: 4.0.0
     The *timing* parameter.
class_docstr_tok: ["Optimizer\/UpdateRule","hook","function","for","Lasso","regularization",".","This","hook","function","adds","a","scaled","parameter","to","the","sign","of","each","weight",".","It","can","be","used","as","a","regularization",".","Args",":","rate","(","float",")",":","Coefficient","for","the","weight","decay",".","Attributes",":","~optimizer_hooks.Lasso.rate","(","float",")",":","Coefficient","for","the","weight","decay",".","~optimizer_hooks.Lasso.timing","(","string",")",":","Specifies","when","this","hook","should","be","called","by","the","Optimizer\/UpdateRule",".","Valid","values","are","'pre'","(","before","any","updates",")","and","'post","'","(","after","any","updates",")",".","~optimizer_hooks.Lasso.call_for_each_param","(","bool",")",":","Specifies","if","this","hook","is","called","for","each","parameter","(","``","True","``",")","or","only","once","(","``","False","``",")","by","an","optimizer","to","which","this","hook","is","registered",".","This","function","does","not","expect","users","to","switch","the","value","from","default","one",",","which","is","`","True","`",".","..","versionadded",":",":","4.0.0","The","*","timing","*","parameter","."]
code: def __init__(self, rate):
      self.rate = rate
  
imports: import chainer
  from chainer import cuda
label_desc: Use image node_id 1 to create a new Lasso object from inherited base classes: object with example: obj = Lasso(rate)