parameters: (X, W, Ht, l1_reg, l2_reg, shuffle,
                                 random_state)
return_statement: return _update_cdnmf_fast(W, HHt, XHt, permutation)
docstring: Helper function for _fit_coordinate_descent
  
      Update W to minimize the objective function, iterating once over all
      coordinates. By symmetry, to update H, one can call
      _update_coordinate_descent(X.T, Ht, W, ...)
docstring_summary: Helper function for _fit_coordinate_descent
docstring_tokens: Helper function for _fit_coordinate_descent
function: def _update_coordinate_descent(X, W, Ht, l1_reg, l2_reg, shuffle,
                                 random_state):
      """Helper function for _fit_coordinate_descent
  
      Update W to minimize the objective function, iterating once over all
      coordinates. By symmetry, to update H, one can call
      _update_coordinate_descent(X.T, Ht, W, ...)
  
      """
      n_components = Ht.shape[1]
  
      HHt = np.dot(Ht.T, Ht)
      XHt = safe_sparse_dot(X, Ht)
  
      # L2 regularization corresponds to increase of the diagonal of HHt
      if l2_reg != 0.:
          # adds l2_reg only on the diagonal
          HHt.flat[::n_components + 1] += l2_reg
      # L1 regularization corresponds to decrease of each element of XHt
      if l1_reg != 0.:
          XHt -= l1_reg
  
      if shuffle:
          permutation = random_state.permutation(n_components)
      else:
          permutation = np.arange(n_components)
      # The following seems to be required on 64-bit Windows w/ Python 3.5.
      permutation = np.asarray(permutation, dtype=np.intp)
      return _update_cdnmf_fast(W, HHt, XHt, permutation)
function_tokens: def _update_coordinate_descent ( X , W , Ht , l1_reg , l2_reg , shuffle , random_state ) : n_components = Ht . shape [ 1 ] HHt = np . dot ( Ht . T , Ht ) XHt = safe_sparse_dot ( X , Ht ) # L2 regularization corresponds to increase of the diagonal of HHt if l2_reg != 0. : # adds l2_reg only on the diagonal HHt . flat [ : : n_components + 1 ] += l2_reg # L1 regularization corresponds to decrease of each element of XHt if l1_reg != 0. : XHt -= l1_reg if shuffle : permutation = random_state . permutation ( n_components ) else : permutation = np . arange ( n_components ) # The following seems to be required on 64-bit Windows w/ Python 3.5. permutation = np . asarray ( permutation , dtype = np . intp ) return _update_cdnmf_fast ( W , HHt , XHt , permutation )