This function generates multiple random candidate U matrices, evaluates their associated energy (without gradient descent), and returns the best-scoring initialization. A seed parameter ensures reproducibility across runs.

optimal_simlr_initializer(
  data_matrices,
  n_init = 10,
  basisK,
  energyType = "acc",
  domainMatrices = NULL,
  domainLambdas = NULL,
  verbose = TRUE,
  seed = NULL
)

Arguments

data_matrices

A list of modality-specific data matrices.

n_init

Number of random initializations to try (default = 10).

basisK

Number of basis components (columns in U).

energyType

Energy function to evaluate.

domainMatrices

Optional list of domain priors (same length as data_matrices).

domainLambdas

Optional vector of domain weights.

verbose

Logical, whether to print progress.

seed

Optional numeric seed for reproducibility (default = NULL, no seed set).

Value

A list with elements:

bestU

List of U matrices (one per modality) for the best initialization.

bestV

List of corresponding V matrices.

bestEnergy

Mean energy for the selected initialization.