Regularised coupled matrix factorisation with AO-ADMM
Project description
Learning coupled matrix factorizations with Python
MatCoupLy is a Python library for learning coupled matrix factorizations with flexible constraints and regularization with Python.
Installation
To install MatCoupLy and all MIT-compatible dependencies from PyPI, you can run
pip install matcouply
If you also want to enable total variation regularization, you need to install all components, which comes with a GPL-v3 lisence
pip install matcouply[all]
About
MatCoupLy uses AO-ADMM to fit constrained and regularised coupled matrix factorization (and PARAFAC2) models. It uses the alternating updates with the alternating direction method of multipliers (AO-ADMM) algorithm, which is very flexible in terms of constraints [1, 2]
Example
Below is a simulated example, where a set of three random non-negative coupled matrices are generated and decomposed using a non-negative PARAFAC2 factorization with both L1 and L2 penalty functions.
from matcouply import cmf_aoadmm
from matcouply.random import random_coupled_matrices
simulated_components = random_coupled_matrices(rank=3, shapes=((40, 25), (35, 25), (19, 25)))
simulated_data = simulated_components.to_matrices()
estimated_cmf, aux_vars, dual_vars = cmf_aoadmm(
simulated_data,
rank=3,
non_negative=True,
l1_penalty=[0.1, 0.2, 0.1],
l2_penalty={2: 1},
parafac2=True
)
est_weights, (est_A, est_B_is, est_C) = estimated_cmf
References
[1]: Roald M, Schenker C, Cohen JE, Acar E. PARAFAC2 AO-ADMM: Constraints in all modes. EUSIPCO (2021).
[2]: Roald M, Schenker C, Bro R, Cohen JE, Acar E. An AO-ADMM approach to constraining PARAFAC2 on all modes (2021). arXiv preprint arXiv:2110.01278.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for matcouply-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a27da77d94aad8fe636fc22ff548becf810c77610c3b44470ac86b315c48212 |
|
MD5 | f74c839a6129c24849d695b28191d128 |
|
BLAKE2b-256 | 9474ba2d8bfe731a51947cfd327fc7594b101a18a4518fdd0071e6cb7b4a81ab |