CP random initialization: suggestion for consistency across methods
Currently, there are several methods for computing CP models, and most create random initial guesses in different way. Furthermore, some initial guesses create in one method cannot be used in other methods without modification.
Suggestion: Standardize the mechanism for creating a random initial guess and the form of the initial guess as a ktensor
across the CP methods that use a ktensor
for its model.
Exceptions: The CP model used in cp_isym
and cp_sym
is a symktensor
, so this suggestion does not apply to those methods.
Here are the current approaches for creating random initial guesses in the CP methods:
-
cp_als
:- Format: cell array of factor matrices
-
Random entries: populates all but one factor matrix (
dimorder(2:end)
) with random entries usingrand
- Scaling: none
- Normalization: none
-
Issues:
- Cannot be used directly in methods that expect a
ktensor
as input. - If used in subsequent runs with a different
disorder
, this leads to an error:
- Cannot be used directly in methods that expect a
>> rng(1); [M_als, M0_als] = cp_als(X,5,'printitn',0);
>> [M_als, M0_als] = cp_als(X,5,'dimorder',[3 2 1],'init',M0_als);
Error using cp_als (line 81)
OPTS.init{1} is the wrong size
-
cp_apr
:-
Format:
ktensor
-
Random entries: populates all factor matrices with random entries using
rand
- Scaling: none
-
Normalization: none (normalization in first step of algorithm, but it does not change the initial guess:
M = normalize(Minit,[],1);
) - Issues:
- Cannot be used directly in methods that do not expect a
ktensor
as input.
- Cannot be used directly in methods that do not expect a
-
Format:
-
cp_arls
:- Same as
cp_als
- Same as
-
cp_nmu
:- Format: cell array of factor matrices
-
Random entries: populates all factor matrices with random entries using
rand
- Scaling: none
- Normalization: none
- Issues:
- Cannot be used directly in methods that expect a
ktensor
as input.
- Cannot be used directly in methods that expect a
-
cp_opt
:- Format: cell array of factor matrices
-
Random entries: populates all factor matrices with random entries using
randn
by default, but also supportsrand
andrandom
- Scaling: none
-
Normalization: uses
matrandnorm
- Issues:
- Cannot be used directly in methods that expect a
ktensor
as input. - The documentation does not discuss how to initialize using
random
(i.e., the more general method for generating random entries using different distributions)
- Cannot be used directly in methods that expect a
-
cp_wopt
:- Same as
cp_opt
- Same as
-
gcp_opt
:-
Format:
ktensor
-
Random entries: populates all factor matrices with random entries using
rand
-
Scaling: proportional to norm of data tensor (
M0 = M0 * (norm(X)/norm(M0));
) -
Normalization: normalizes factors, distributing weights
M0 = normalize(M0,0);
- Issues:
- Cannot be used directly in methods that do not expect a
ktensor
as input. - Normalizing with dimension 0 is not documented.
- Cannot be used directly in methods that do not expect a
-
Format: