Skip to main content

Regularised coupled matrix factorisation with AO-ADMM

Project description

Learning coupled matrix factorizations with Python

Tests Coverage Documentation Status https://img.shields.io/badge/code%20style-black-000000.svg

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

Illustration of a coupled matrix factorization

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

matcouply-0.0.1.tar.gz (4.2 MB view hashes)

Uploaded Source

Built Distribution

matcouply-0.0.1-py2.py3-none-any.whl (32.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page