class_docstr: A class wrapper for the tensor_ring_als function
  
  Attributes
  ----------
  rank : Union[int, List[int]]
      The rank of the decomposition. If `rank` is an int, then all ranks will be the
      same and equal to `rank`. If `rank` is a list, then the i-th core will be of
      size rank[i]-by-shape[i]-by-rank[i+1], where shape[i] is the dimension of the
      i-th mode of `tensor`.
  ls_solve : {"lstsq", "normal_eq"}
      When equal to "lstsq", the least squares problems are solved as overdetermined
      systems of equations using tl.lstsq. When equal to "normal_eq", a normal
      equation formulation is used instead together with tl.solve. This latter
      approach is expected to yield poorer accuracy due to numerical issuse with the
      normal equations.
  n_iter_max : int
      Maximum number of ALS iterations.
  tol : float
      The algorithm is terminated when the change in the relative reconstruction error
      is less than `tol`.
  random_state : {None, int, np.random.RandomState}
      Used to set the random seed in the algorithm.
  verbose : bool
      If True, the algorithm will make some additional print outs.
  callback : {None, Callable[[tl.tr_tensor.TRTensor, float], {None, bool}]}
      A callback function which can be used for, e.g., logging the per-iteration
      error. Such a function takes two inputs: A tensor ring decomposition and a float
      which indicates the relative reconstruction error between `tensor` and the
      inputted TRTensor. It can return a bool which can be used to control when the
      ALS algorithm terminates.
  
  Methods
  -------
  fit_transformation(tensor)
      Computes the decomposition of `tensor`.
class_docstr_tok: ["A","class","wrapper","for","the","tensor_ring_als","function","Attributes","--","--","--","--","--","rank",":","Union","[","int",",","List","[","int","]","]","The","rank","of","the","decomposition",".","If","`","rank","`","is","an","int",",","then","all","ranks","will","be","the","same","and","equal","to","`","rank","`",".","If","`","rank","`","is","a","list",",","then","the","i-th","core","will","be","of","size","rank","[","i","]","-by-shape","[","i","]","-by-rank","[","i+1","]",",","where","shape","[","i","]","is","the","dimension","of","the","i-th","mode","of","`","tensor","`",".","ls_solve",":","{","``","lstsq","''",",","``","normal_eq","''","}","When","equal","to","``","lstsq","''",",","the","least","squares","problems","are","solved","as","overdetermined","systems","of","equations","using","tl.lstsq",".","When","equal","to","``","normal_eq","''",",","a","normal","equation","formulation","is","used","instead","together","with","tl.solve",".","This","latter","approach","is","expected","to","yield","poorer","accuracy","due","to","numerical","issuse","with","the","normal","equations",".","n_iter_max",":","int","Maximum","number","of","ALS","iterations",".","tol",":","float","The","algorithm","is","terminated","when","the","change","in","the","relative","reconstruction","error","is","less","than","`","tol","`",".","random_state",":","{","None",",","int",",","np.random.RandomState","}","Used","to","set","the","random","seed","in","the","algorithm",".","verbose",":","bool","If","True",",","the","algorithm","will","make","some","additional","print","outs",".","callback",":","{","None",",","Callable","[","[","tl.tr_tensor.TRTensor",",","float","]",",","{","None",",","bool","}","]","}","A","callback","function","which","can","be","used","for",",","e.g.",",","logging","the","per-iteration","error",".","Such","a","function","takes","two","inputs",":","A","tensor","ring","decomposition","and","a","float","which","indicates","the","relative","reconstruction","error","between","`","tensor","`","and","the","inputted","TRTensor",".","It","can","return","a","bool","which","can","be","used","to","control","when","the","ALS","algorithm","terminates",".","Methods","--","--","--","-","fit_transformation","(","tensor",")","Computes","the","decomposition","of","`","tensor","`","."]
docstr: Computes the decomposition of `tensor`.
  
  Parameters
  ----------
  tensor : ndarray
  
  Returns
  -------
  decomposition_ : tl.tr_tensor.TRTensor
      The tensor ring decomposition computed by the algorithm.
docstr_tok: ["Computes","the","decomposition","of","`","tensor","`",".","Parameters","--","--","--","--","--","tensor",":","ndarray","Returns","--","--","--","-","decomposition_",":","tl.tr_tensor.TRTensor","The","tensor","ring","decomposition","computed","by","the","algorithm","."]
code: def fit_transform(self, tensor):
      """Computes the decomposition of `tensor`.
  
      Parameters
      ----------
      tensor : ndarray
  
      Returns
      -------
      decomposition_ : tl.tr_tensor.TRTensor
          The tensor ring decomposition computed by the algorithm.
      """
  
      tr_decomp = tensor_ring_als(
          tensor,
          rank=self.rank,
          ls_solve=self.ls_solve,
          n_iter_max=self.n_iter_max,
          tol=self.tol,
          random_state=self.random_state,
          verbose=self.verbose,
          callback=self.callback,
      )
      self.decomposition_ = tr_decomp
      return self.decomposition_
  
file_path: tensorly/tensorly/decomposition/_tr.py
imports: import tensorly
  from ._base_decomposition import DecompositionMixin
  from ..base import matricize
  from ..tr_tensor import validate_tr_rank, TRTensor
  from ..tenalg.svd import svd_interface
label_desc: Use image node_id 2 for calling the TensorRingALS obj's underlying member method code with example usage: obj.fit_transform(tensor) and returns: self