Describe the bug
initialize_cp() in _cp.py does not pass rng to svd_interface() in the init == "svd" case, meaning there is no way to fix the random state when using the "randomized_svd" initialization method.
Steps or Code to Reproduce
I was using the parafac2 method but anything that calls initialize_cp() would be effected.
The lack of fixed state should be apparent by specifying init="svd", svd="randomized_svd", and random_state=42 when calling the parafac2() method.
Expected behavior
I would expect resulting factor matrices to be equal when fixed state is specified
Actual result
Factor matrices experience run-to-run variation.
Versions
Linux-6.17.0-8-generic-x86_64-with-glibc2.42
Python 3.12.6 (main, Sep 9 2024, 22:11:19) [Clang 18.1.8 ]
NumPy 2.3.5
SciPy 1.16.3
TensorLy 0.9.0
CuPy 13.6.0
Describe the bug
initialize_cp()in_cp.pydoes not passrngtosvd_interface()in theinit == "svd"case, meaning there is no way to fix the random state when using the "randomized_svd" initialization method.Steps or Code to Reproduce
I was using the parafac2 method but anything that calls
initialize_cp()would be effected.The lack of fixed state should be apparent by specifying
init="svd",svd="randomized_svd", andrandom_state=42when calling theparafac2()method.Expected behavior
I would expect resulting factor matrices to be equal when fixed state is specified
Actual result
Factor matrices experience run-to-run variation.
Versions
Linux-6.17.0-8-generic-x86_64-with-glibc2.42
Python 3.12.6 (main, Sep 9 2024, 22:11:19) [Clang 18.1.8 ]
NumPy 2.3.5
SciPy 1.16.3
TensorLy 0.9.0
CuPy 13.6.0