parameters: (self,
                 input_rows,
                 input_cols,
                 n_components,
                 unobserved_weight=0.1,
                 regularization=None,
                 row_init="random",
                 col_init="random",
                 num_row_shards=1,
                 num_col_shards=1,
                 row_weights=None,
                 col_weights=None)
docstring: Creates model for WALS matrix factorization.
  
      Args:
        input_rows: total number of rows for input matrix.
        input_cols: total number of cols for input matrix.
        n_components: number of dimensions to use for the factors.
        unobserved_weight: weight given to unobserved entries of matrix.
        regularization: weight of L2 regularization term. If None, no
          regularization is done.
        row_init: initializer for row factor. Can be a tensor or numpy constant.
          If set to "random", the value is initialized randomly.
        col_init: initializer for column factor. See row_init for details.
        num_row_shards: number of shards to use for row factors.
        num_col_shards: number of shards to use for column factors.
        row_weights: If not None, along with col_weights, used to compute the
          weight of an observed entry. w_ij = unobserved_weight + row_weights[i] *
          col_weights[j]. If None, then w_ij = unobserved_weight, which simplifies
          to ALS.
        col_weights: See row_weights
docstring_summary: Creates model for WALS matrix factorization.
docstring_tokens: Creates model for WALS matrix factorization .
function: def __init__(self,
                 input_rows,
                 input_cols,
                 n_components,
                 unobserved_weight=0.1,
                 regularization=None,
                 row_init="random",
                 col_init="random",
                 num_row_shards=1,
                 num_col_shards=1,
                 row_weights=None,
                 col_weights=None):
      """Creates model for WALS matrix factorization.
  
      Args:
        input_rows: total number of rows for input matrix.
        input_cols: total number of cols for input matrix.
        n_components: number of dimensions to use for the factors.
        unobserved_weight: weight given to unobserved entries of matrix.
        regularization: weight of L2 regularization term. If None, no
          regularization is done.
        row_init: initializer for row factor. Can be a tensor or numpy constant.
          If set to "random", the value is initialized randomly.
        col_init: initializer for column factor. See row_init for details.
        num_row_shards: number of shards to use for row factors.
        num_col_shards: number of shards to use for column factors.
        row_weights: If not None, along with col_weights, used to compute the
          weight of an observed entry. w_ij = unobserved_weight + row_weights[i] *
          col_weights[j]. If None, then w_ij = unobserved_weight, which simplifies
          to ALS.
        col_weights: See row_weights
      """
      self._input_rows = input_rows
      self._input_cols = input_cols
      self._num_row_shards = num_row_shards
      self._num_col_shards = num_col_shards
      self._n_components = n_components
      self._unobserved_weight = unobserved_weight
      self._regularization = (tf.diag(tf.constant(regularization,
                                                  shape=[self._n_components],
                                                  dtype=tf.float32))
                              if regularization is not None else None)
      assert (row_weights is None) == (col_weights is None)
      self._row_weights = WALSModel._create_weights(row_weights,
                                                    self._input_rows,
                                                    self._num_row_shards,
                                                    "row_weights")
      self._col_weights = WALSModel._create_weights(col_weights,
                                                    self._input_cols,
                                                    self._num_col_shards,
                                                    "col_weights")
      self._row_factors = self._create_factors(self._input_rows,
                                               self._n_components,
                                               self._num_row_shards,
                                               row_init,
                                               "row_factors")
      self._col_factors = self._create_factors(self._input_cols,
                                               self._n_components,
                                               self._num_col_shards,
                                               col_init,
                                               "col_factors")
      self._create_transient_vars()
function_tokens: def __init__ ( self , input_rows , input_cols , n_components , unobserved_weight = 0.1 , regularization = None , row_init = "random" , col_init = "random" , num_row_shards = 1 , num_col_shards = 1 , row_weights = None , col_weights = None ) : self . _input_rows = input_rows self . _input_cols = input_cols self . _num_row_shards = num_row_shards self . _num_col_shards = num_col_shards self . _n_components = n_components self . _unobserved_weight = unobserved_weight self . _regularization = ( tf . diag ( tf . constant ( regularization , shape = [ self . _n_components ] , dtype = tf . float32 ) ) if regularization is not None else None ) assert ( row_weights is None ) == ( col_weights is None ) self . _row_weights = WALSModel . _create_weights ( row_weights , self . _input_rows , self . _num_row_shards , "row_weights" ) self . _col_weights = WALSModel . _create_weights ( col_weights , self . _input_cols , self . _num_col_shards , "col_weights" ) self . _row_factors = self . _create_factors ( self . _input_rows , self . _n_components , self . _num_row_shards , row_init , "row_factors" ) self . _col_factors = self . _create_factors ( self . _input_cols , self . _n_components , self . _num_col_shards , col_init , "col_factors" ) self . _create_transient_vars ( )