-
3.39.22
|
The simplified parameterization class for factorizing a rectangular matrix with the hierarchical factorization algorithm (pyfaust.fact.hierarchical). More...
Public Member Functions | |
def | __init__ (self, m, n, j, k, s, rho=0.8, P=1.4) |
Constructor for the specialized parameterization used for example in the pyfaust.demo.bsl (brain souce localization). More... | |
Public Member Functions inherited from pyfaust.factparams.ParamsHierarchical | |
def | __init__ (self, fact_constraints, res_constraints, stop_crit1, stop_crit2, is_update_way_R2L=False, init_lambda=1.0, step_size=10.0 **-16, constant_step_size=False, is_fact_side_left=False, is_verbose=False, factor_format='dynamic', packing_RL=True, no_normalization=False, no_lambda=False, norm2_max_iter=100, norm2_threshold=1e-6, grad_calc_opt_mode=ParamsFact.EXTERNAL_OPT, **kwargs) |
Constructor. More... | |
def | are_constraints_consistent (self, M) |
This method verifies that the constraints are shape-consistent to the matrix/array M to factorize and with each other. More... | |
def | __repr__ (self) |
Returns object representation. More... | |
Public Member Functions inherited from pyfaust.factparams.ParamsFact | |
def | __init__ (self, num_facts, is_update_way_R2L, init_lambda, constraints, step_size, constant_step_size, is_verbose, factor_format='dynamic', packing_RL=True, no_normalization=False, no_lambda=False, norm2_max_iter=100, norm2_threshold=1e-6, grad_calc_opt_mode=EXTERNAL_OPT, **kwargs) |
Static Public Member Functions | |
def | createParams (M, p) |
Static member function to create a ParamsHierarchicalRectMat instance by a simplified parameterization expression. More... | |
Static Public Member Functions inherited from pyfaust.factparams.ParamsFact | |
def | factor_format_str2int (factor_format) |
def | factor_format_int2str (factor_format) |
def | get_constraints (projs) |
Returns a python list of constraints from the projs which is a ConstralintList or a list/tuple that can be a mix of ConstraintGeneric or pyfaust.proj.proj_gen. More... | |
Additional Inherited Members | |
Public Attributes inherited from pyfaust.factparams.ParamsFact | |
step_size | |
constant_step_size | |
norm2_max_iter | |
norm2_threshold | |
factor_format | |
packing_RL | |
no_normalization | |
no_lambda | |
use_MHTP | |
The simplified parameterization class for factorizing a rectangular matrix with the hierarchical factorization algorithm (pyfaust.fact.hierarchical).
The parameters m and n are the dimensions of the input matrix.
def pyfaust.factparams.ParamsHierarchicalRectMat.__init__ | ( | self, | |
m, | |||
n, | |||
j, | |||
k, | |||
s, | |||
rho = 0.8 , |
|||
P = 1.4 |
|||
) |
Constructor for the specialized parameterization used for example in the pyfaust.demo.bsl (brain souce localization).
For a better understanding you might refer to [1].
The figure below describes the sparsity of each factor of the Faust you'll obtain using pyfaust.fact.hierarchical with a ParamsHierarchicalRectMat instance.
The resulting Faust.nnz_sum is: \(\lceil P m^2 \rho^{j-2} \rceil + (j-2) s m + k n\)
m | (int) the number of rows of the input matrix. |
n | (int) the number of columns of the input matrix. |
j | (int) the total number of factors. |
k | (int) the integer sparsity per column (SPCOL, pyfaust.proj.spcol) applied to the rightmost factor (index j-1) of shape (m, n). |
s | (int) s*m is the integer sparsity targeted (SP, pyfaust.proj.sp) for all the factors from the second (index 1) to index j-2. These factors are square of order n. |
rho | (float) defines the integer sparsity (SP, pyfaust.proj.sp) of the i-th residual (i=0:j-2): ceil(P*m**2*rho**i). |
P | (float) defines the integer sparsity of the i-th residual (i=0:j-2): ceil(P*m**2*rho**i). |
Examples
[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]
|
static |
Static member function to create a ParamsHierarchicalRectMat instance by a simplified parameterization expression.
p | a list of the form ['rectmat', j, k, s] or [['rectmat', num_facts, k, s], {'rho': rho, 'P': P}] to create a parameter instance with the parameters j, k, s and optionally rho and P (see the class constructor ParamsHierarchicalRectMat.__init__ for their definitions). |
Examples
Reimplemented in pyfaust.factparams.ParamsHierarchicalRectMatNoResCons.