Implementation of IVA-G and IVA-L-SOS
Project description
Independent Vector Analysis
This package contains the Python versions of IVA-G and IVA-L-SOS, converted from the MLSP-Lab MATLAB Codes.
- Website: http://mlsp.umbc.edu/jointBSS_introduction.html
- Source-code: https://github.com/SSTGroup/independent_vector_analysis
Installing independent_vector_analysis
The only pre-requisite is to have Python 3 installed. The iva package can be installed with
pip install independent_vector_analysis
Required third party packages will automatically be installed.
Quickstart
First, the imports:
import numpy as np
from independent_vector_analysis import iva_g, consistent_iva
from independent_vector_analysis.data_generation import generate_sources
Create a dataset with N=3 sources, which are correlated across K=4 datasets. Each source consists of T=10000 samples:
N = 3
K = 4
T = 10000
rho = 0.7
S = generate_sources(rho, N, T, K)
A = np.random.randn(N,N,K)
X = np.einsum('MNK, NTK -> MTK', A, S)
Apply IVA-G to reconstruct the sources. If the mixing matrix A is passed, the ISI is calculated. Let the demixing matrix W be initialized by joint diagonalization:
W, cost, Sigma_n, isi = iva_g(X, A=A, jdiag_initW=True)
W is the estimated demixing matrix. cost is the cost for each iteration. Sigma_n[:,:,n] contains the covariance matrix of the nth SCV. isi is the joint ISI for each iteration.
Find the most consistent result of 500 runs in IVA-L-SOS:
iva_results = consistent_iva(X, which_iva='iva_l_sos', n_runs=500)
where iva_results is a dict containing:
- 'W' : estimated demixing matrix of dimensions N x N x K
- 'W_change' : change in W for each iteration
- 'S' : estimated sources of dimensions N x T x K
- 'A' : estimated mixing matrix of dimensions N x N x K
- 'scv_cov' : covariance matrices of the SCVs, of dimensions K x K x N (the same as Sigma_n in iva_g / iva_l_sos)
- 'cross_isi' : cross joint ISI for each run compated with all other runs
Citing
If you use this package in an academic paper, please cite [1]
@inproceedings{Lehmann2022,
author = {Lehmann, Isabell and Acar, Evrim and Hasija, Tanuj and Akhonda, M.A.B.S. and Calhoun, Vince D. and Schreier, Peter J. and Adali, Tulay},
title = {Multi-task fMRI Data Fusion Using IVA and PARAFAC2},
journal = {unpublished work}
}
[1] Isabell Lehmann, Evrim Acar, et. al, Multi-task fMRI Data Fusion Using IVA and PARAFAC2, unpublished work.
Project details
Release history Release notifications | RSS feed
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 independent_vector_analysis-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78cbbd4ee8c7ddbead87689a2076c38cb4ea631f25f2edaeb3fcd3e7a18b30e8 |
|
MD5 | ceec862365e084fefdfb7f8368659f0a |
|
BLAKE2b-256 | afe88dfe632e4e54b0db400b9a13bf508e87dbd1e72d27394e399e350404b71a |
Hashes for independent_vector_analysis-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e113e36f9b7f79f16b95c363ba2cbc8f0d2b57c6a0b84e743ec3c3b8a6b11359 |
|
MD5 | e642960a2939cf9ef74497f57e098ca2 |
|
BLAKE2b-256 | 1d56ee75f98844f949078bcf6f2565b54b82a1e3cb0c0350de1bf561ed6019d9 |