gemmr.generative_model._add_lowvariance_subspace_components

gemmr.generative_model._add_lowvariance_subspace_components(U, U_dominant, V, V_dominant, m, qx, qy, rng, min_weight=0)

Add a component from the low-variance subspace to the weight vectors living in the dominant high-variance subspace.

Separately for X and Y, a random rotation matrix is calculated for the low-variance subspace (of dimension qx and qy) via QR decomposition of a matrix with random entries drawn from a standard normal distribution. The Q factor is then post-multiplied with the last qx and qy columns of the basis vectors U and V. Then, a random weight is chosen (between min_weight and 1) and the weighted linear combination of the dominant subspace weights (U_dominant and V_dominant) with the low-variance subspace weights is computed and returned.

Parameters:
  • U (np.ndarray (px, px)) – basis vectors for X
  • U_dominant (np.ndarray (px, m)) – weight vectors for X living in the dominant subspace
  • V (np.ndarray (py, py)) – basis vectors for Y
  • V_dominant (np.ndarray (py, m)) – weight vectors for Y living in the dominant subspace
  • m (int) – number of between-set association modes
  • qx (int) – dimensionality of dominant subspace for X
  • qy (int) – dimensionality for dominant subspace for Y
  • rng (random number generator instance) –
  • min_weight (float, 0 <= min_weight <= 1) – minimum weight given to the weight vectors from the dominant subspace
Returns:

  • U_ (np.ndarray (px, m)) – weight vectors for X
  • V_ (np.ndarray (py, m)) – weight vectors for Y