FAµST (Flexible Approximate MUlti-layer Sparse Transforms)  3.37.4
Static Public Member Functions | List of all members
pyfaust.demo.bsl Class Reference

Brain Source Localization demo. More...

Static Public Member Functions

def sparse_coeffs (D, ntraining, sparsity)
 Generates sparse coefficients. More...
 
def run (input_data_dir=get_data_dirpath(silent=False), output_dir=DEFT_RESULTS_DIR, on_gpu=False)
 This function performs brain source localization. More...
 
def fig (input_dir=DEFT_RESULTS_DIR, output_dir=DEFT_FIG_DIR)
 Calls all fig*() functions of bsl demo. More...
 
def fig_time_cmp (input_dir=DEFT_RESULTS_DIR, output_dir=DEFT_FIG_DIR, use_precomputed_data=False)
 Builds the time comparison figure for the BSL with the differents Faust representations of the MEG matrix. More...
 
def fig_speedup (input_dir=DEFT_RESULTS_DIR, output_dir=DEFT_FIG_DIR)
 Builds the speedup comparison figure for the BSL with the differents Faust representations of the MEG matrix. More...
 
def fig_convergence (input_dir=DEFT_RESULTS_DIR, output_dir=DEFT_FIG_DIR)
 This function builds a figure similar to the BSL figure (Fig 9) used in [1]. More...
 

Detailed Description

Brain Source Localization demo.

Member Function Documentation

◆ fig()

def pyfaust.demo.bsl.fig (   input_dir = DEFT_RESULTS_DIR,
  output_dir = DEFT_FIG_DIR 
)
static

Calls all fig*() functions of bsl demo.

Note
Must be call after the bsl.run function.

◆ fig_convergence()

def pyfaust.demo.bsl.fig_convergence (   input_dir = DEFT_RESULTS_DIR,
  output_dir = DEFT_FIG_DIR 
)
static

This function builds a figure similar to the BSL figure (Fig 9) used in [1].

References
[1] Le Magoarou L. and Gribonval R., "Flexible multi-layer sparse approximations of matrices and applications", Journal of Selected Topics in Signal Processing, 2016. https://hal.archives-ouvertes.fr/hal-01167948v1

◆ fig_speedup()

def pyfaust.demo.bsl.fig_speedup (   input_dir = DEFT_RESULTS_DIR,
  output_dir = DEFT_FIG_DIR 
)
static

Builds the speedup comparison figure for the BSL with the differents Faust representations of the MEG matrix.

◆ fig_time_cmp()

def pyfaust.demo.bsl.fig_time_cmp (   input_dir = DEFT_RESULTS_DIR,
  output_dir = DEFT_FIG_DIR,
  use_precomputed_data = False 
)
static

Builds the time comparison figure for the BSL with the differents Faust representations of the MEG matrix.

◆ run()

def pyfaust.demo.bsl.run (   input_data_dir = get_data_dirpath(silent=False),
  output_dir = DEFT_RESULTS_DIR,
  on_gpu = False 
)
static

This function performs brain source localization.

It uses several gain matrices [2], including FAuSTs, and OMP solver. It reproduces the source localization experiment of [1]. The results are stored in output_dir+"results_BSL_user.mat".

Parameters
on_gpuif True the demo is ran on GPU (if cuda backend is available).
DURATION
Computations should take around 3 minutes.

The MEG gain matrices used are the precomputed ones in

get_data_dirpath()+"/faust_MEG_rcg_X.mat"

(in the installation directory of the FAuST toolbox)

References
[1] Le Magoarou L. and Gribonval R., "Flexible multi-layer sparse approximations of matrices and applications", Journal of Selected Topics in Signal Processing, 2016. https://hal.archives-ouvertes.fr/hal-01167948v1
[2] A. Gramfort, M. Luessi, E. Larson, D. Engemann, D.
Strohmeier, C. Brodbeck, L. Parkkonen, M. Hamalainen, MNE
software for processing MEG and EEG data http://www.ncbi.nlm.nih.gov/pubmed/24161808, NeuroImage, Volume 86, 1 February 2014, Pages 446-460, ISSN 1053-8119

◆ sparse_coeffs()

def pyfaust.demo.bsl.sparse_coeffs (   D,
  ntraining,
  sparsity 
)
static

Generates sparse coefficients.

Gamma = sparse_coeffs(D, ntraining, sparsity) generates ntraining sparse vectors stacked in a matrix Gamma.

Each sparse vector is of size the number of atoms in the dictionary D, its support is drawn uniformly at random and each non-zero entry is iid Gaussian.

References
[1] Le Magoarou L. and Gribonval R., "Learning computationally efficient dictionaries and their implementation as fast transforms", submitted to NIPS 2014

The documentation for this class was generated from the following file:
pyfaust.demo.get_data_dirpath
def get_data_dirpath(silent=True)
Returns the data directory path which varies according to the way pyfaust was installed.
Definition: demo.py:69