class_docstr: The Ftrl optimizer.
  
  Referenced from *Ad Click Prediction: a View from the Trenches*, available at
  http://dl.acm.org/citation.cfm?id=2488200.
  
  eta :
      .. math::
         \eta_{t,i} = \frac{learningrate}{\beta+\sqrt{\sum_{s=1}^tg_{s,i}^2}}
  
  The optimizer updates the weight by::
  
      rescaled_grad = clip(grad * rescale_grad, clip_gradient)
      z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
      n += rescaled_grad**2
      w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
  
  If the storage types of weight, state and grad are all ``row_sparse``,     **sparse updates** are applied by::
  
      for row in grad.indices:
          rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
          z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
          n[row] += rescaled_grad[row]**2
          w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
  
  The sparse update only updates the z and n for the weights whose row_sparse
  gradient indices appear in the current batch, rather than updating it for all
  indices. Compared with the original update, it can provide large
  improvements in model training throughput for some applications. However, it
  provides slightly different semantics than the original update, and
  may lead to different empirical results.
  
  For details of the update algorithm, see :class:`~mxnet.ndarray.ftrl_update`.
  
  This optimizer accepts the following parameters in addition to those accepted
  by :class:`.Optimizer`.
  
  Parameters
  ----------
  learning_rate : float, default 0.1
      The initial learning rate. If None, the optimization will use the
      learning rate from ``lr_scheduler``. If not None, it will overwrite
      the learning rate in ``lr_scheduler``. If None and ``lr_scheduler``
      is also None, then it will be set to 0.01 by default.
  lamda1 : float, default 0.01
      L1 regularization coefficient.
  beta : float, default 1.0
      Per-coordinate learning rate correlation parameter.
  use_fused_step : bool, default True
      Whether or not to use fused kernels for optimizer.
      When use_fused_step=False, step is called,
      otherwise, fused_step is called.
docstr: Perform an optimization step using gradients and states.
  
  Parameters
  ----------
  indices : list of int
      List of unique indices of the parameters into the individual learning rates
      and weight decays. Learning rates and weight decay may be set via `set_lr_mult()`
      and `set_wd_mult()`, respectively.
  weights : list of NDArray
      List of parameters to be updated.
  grads : list of NDArray
      List of gradients of the objective with respect to this parameter.
  states : List of any obj
      List of state returned by `create_state()`.
docstr_tok: ["Perform","an","optimization","step","using","gradients","and","states",".","Parameters","--","--","--","--","--","indices",":","list","of","int","List","of","unique","indices","of","the","parameters","into","the","individual","learning","rates","and","weight","decays",".","Learning","rates","and","weight","decay","may","be","set","via","`","set_lr_mult","(",")","`","and","`","set_wd_mult","(",")","`",",","respectively",".","weights",":","list","of","NDArray","List","of","parameters","to","be","updated",".","grads",":","list","of","NDArray","List","of","gradients","of","the","objective","with","respect","to","this","parameter",".","states",":","List","of","any","obj","List","of","state","returned","by","`","create_state","(",")","`","."]
code: def step(self, indices, weights, grads, states):
      """Perform an optimization step using gradients and states.
  
      Parameters
      ----------
      indices : list of int
          List of unique indices of the parameters into the individual learning rates
          and weight decays. Learning rates and weight decay may be set via `set_lr_mult()`
          and `set_wd_mult()`, respectively.
      weights : list of NDArray
          List of parameters to be updated.
      grads : list of NDArray
          List of gradients of the objective with respect to this parameter.
      states : List of any obj
          List of state returned by `create_state()`.
      """
      for index, weight, grad, state in zip(
          indices, weights, grads, states
      ):
          self._update_count(index)
          lr = self._get_lr(index)
          wd = self._get_wd(index)
  
          # preprocess grad
          grad *= self.rescale_grad
          if self.clip_gradient is not None:
              grad = clip(grad, -self.clip_gradient, self.clip_gradient)
  
          # update z, n
          z, n = state
  
          sigma = -sqrt(n)
          n[:] += square(grad)
          denom = sqrt(n)
          sigma += denom
          sigma /= lr
          z[:] += grad - sigma * weight
  
          # update weight
          denom += self.beta
          denom /= lr
          denom += wd
          d = sign(z) * maximum(NDabs(z) - self.lamda1, 0)
          weight[:] = -d / denom
  
file_path: mxnet/python/mxnet/optimizer/ftrl.py
imports: from __future__ import absolute_import
  from ..ndarray import zeros, clip, sqrt, square, sign, maximum, abs
  from ..ndarray import ftrl_update
  from .optimizer import Optimizer, register
label_desc: Use image node_id 3 for calling the Ftrl obj's underlying member method code with example usage: obj.step(indices, weights, grads, states) without return types