-  3.41.0
matfaust::factparams::ParamsHierarchicalNoResCons Class Reference

A ParamsHierarchical specialization for which there is no residual constraints. More...

Public Member Functions

function ParamsHierarchicalNoResCons (fact_constraints, stop_crit1, stop_crit2, varargin)
 Constructor. More...
 
- Public Member Functions inherited from matfaust::factparams::ParamsHierarchical
function ParamsHierarchical (fact_constraints, res_constraints, stop_crit1, stop_crit2, varargin)
 Constructor. More...
 
- Public Member Functions inherited from matfaust::factparams::ParamsFact
function ParamsFact (num_facts, constraints, varargin)
 

Additional Inherited Members

- Static Public Member Functions inherited from matfaust::factparams::ParamsFact
static function factor_format_str2int (factor_format)
 
static function parse_opt_args (cell_args, opt_arg_names, opt_arg_map)
 
static function get_constraints (constraints)
 Returns a cell array of constraints from constraints which is a ConstraintList or cell array that can be a mix of pyfaust.factparams.ConstraintGeneric or pyfaust.proj.proj_gen. If projs is a ConstraintList then the function just returns the same object as is. More...
 
- Public Attributes inherited from matfaust::factparams::ParamsFact
Property step_size
 
Property constant_step_size
 
Property factor_format
 
Property packing_RL
 
Property norm2_max_iter
 
Property norm2_threshold
 
Property use_MHTP
 
Property no_normalization
 
Property no_lambda
 
- Protected Attributes inherited from matfaust::factparams::ParamsHierarchical
Constant Property DEFAULT_IS_FACT_SIDE_LEFT = false
 
- Protected Attributes inherited from matfaust::factparams::ParamsFact
Constant Property DEFAULT_STEP_SIZE = 10
 
Constant Property DEFAULT_VERBOSITY = false
 
Constant Property DEFAULT_CONSTANT_STEP_SIZE = false
 
Constant Property DEFAULT_INIT_LAMBDA = 1.0
 
Constant Property DEFAULT_IS_UPDATE_WAY_R2L = false
 
Constant Property DEFAULT_PACKING_RL = true
 
Constant Property DEFAULT_FACTOR_FORMAT = 'dynamic'
 
Constant Property DEFAULT_NO_NORMALIZATION = false
 
Constant Property DEFAULT_NO_LAMBDA = false
 
Constant Property DEFAULT_NORM2_MAX_ITER = 0
 
Constant Property DEFAULT_NORM2_THRESHOLD = 0
 
Constant Property IDX_FACTOR_FORMAT = 9
 
Constant Property IDX_PACKING_RL = 10
 
Constant Property IDX_NO_NORMALIZATION = 11
 
Constant Property IDX_NO_LAMBDA = 12
 

Detailed Description

A ParamsHierarchical specialization for which there is no residual constraints.

Constructor & Destructor Documentation

◆ ParamsHierarchicalNoResCons()

function matfaust::factparams::ParamsHierarchicalNoResCons::ParamsHierarchicalNoResCons ( fact_constraints  ,
stop_crit1  ,
stop_crit2  ,
varargin   
)

Constructor.

Parameters
fact_constraintsa ConstrainstList or a cell array of matfaust.proj.proj_gen or matfaust.factparams.ConstraintGeneric that define the structure of the pyfaust.fact.hierarchical resulting Faust factors in the same order if is_fact_side_left==true, in the reverse order otherwise.
stop_crit1cf. ParamsHierarchical.ParamsHierarchical
stop_crit2cf. ParamsHierarchical.ParamsHierarchical
'is_update_way_R2L',boolcf. ParamsHierarchical.ParamsHierarchical
'init_lambda',realcf. ParamsHierarchical.ParamsHierarchical
'step_size',realcf. ParamsHierarchical.ParamsHierarchical
'constant_step_size',boolcf. ParamsHierarchical.ParamsHierarchical
'is_fact_side_left',boolcf. ParamsHierarchical.ParamsHierarchical
'is_verbose',boolcf. ParamsHierarchical.ParamsHierarchical
'factor_format',strcf. ParamsHierarchical.ParamsHierarchical
'packing_RL',boolcf. ParamsHierarchical.ParamsHierarchical
'no_normalization',boolcf. ParamsHierarchical.ParamsHierarchical
'no_lambda',boolcf. ParamsHierarchical.ParamsHierarchical
'norm2_max_iter',intcf. ParamsHierarchical.ParamsHierarchical
'norm2_threshold',realcf. ParamsHierarchical.ParamsHierarchical
'grad_calc_opt_mode',intcf. ParamsHierarchical.ParamsHierarchical

Example This example shows two parametrizations that are equivalent. The first one, p1, is defined trough a ParamsHierarchical instance while the second one, p2, is defined using a ParamsHierarchicalNoResCons instance.

>> import matfaust.proj.*
>> import matfaust.factparams.*
>> import matfaust.fact.hierarchical
>> import matfaust.wht
>> H = full(wht(32));
>> d = size(H, 1);
>> n = ceil(log2(d));
>> res_projs = {};
>> fac_projs = {};
>> for i=1:n
.. if i == n
.. res_projs = { res_projs{:}, skperm([d,d], ceil(d/2^i), 'normalized', true)};
.. else
.. res_projs = { res_projs{:}, proj_id([d,d])};
.. end
.. fac_projs = {fac_projs{:}, skperm([d, d], 2, 'normalized', true)};
.. end
>> stop_crit = StoppingCriterion(30);
>> p1 = ParamsHierarchical(fac_projs, res_projs, stop_crit, stop_crit, 'is_update_way_R2L', true, 'packing_RL', false);
>> % factorizing with p1 (ParamsHierarchical) into Faust F1
>> F1 = hierarchical(H, p1, 'backend', 2020);
>> F1_error = norm(full(F1)-H)/norm(H)
F1_error =
0
>> simple_projs = {fac_projs{:}, res_projs{end}};
>> p2 = ParamsHierarchicalNoResCons(simple_projs, stop_crit, stop_crit, 'is_update_way_R2L', true, 'packing_RL', false);
>> % factorizing with p2 (ParamsHierarchical) into Faust F2
>> F2 = hierarchical(H, p2, 'backend', 2020);
>> F2_error = norm(full(F2)-H)/norm(H)
F2_error =
0
>>

F1 =

Faust size 32x32, density 0.34375, nnz_sum 352, 6 factor(s):

  • FACTOR 0 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 1 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 2 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 3 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 4 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 5 (double) SPARSE, size 32x32, density 0.03125, nnz 32

F1_error =

 0

factorizing with p2 (ParamsHierarchical) into Faust F2 Faust::hierarchical: 1/5 Faust::hierarchical: 2/5 Faust::hierarchical: 3/5 Faust::hierarchical: 4/5 Faust::hierarchical: 5/5

F2 =

Faust size 32x32, density 0.34375, nnz_sum 352, 6 factor(s):

  • FACTOR 0 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 1 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 2 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 3 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 4 (double) SPARSE, size 32x32, density 0.0625, nnz 64
  • FACTOR 5 (double) SPARSE, size 32x32, density 0.03125, nnz 32

F2_error =

      0

The documentation for this class was generated from the following file:
matfaust::proj
This module provides matrix projectors.
Definition: +proj/@anticirc/anticirc.m:1
matfaust::wht
function wht(n, varargin)
Constructs a Faust implementing the Walsh-Hadamard Transform (WHT) of order n.
pyfaust.norm
def norm(F, ord='fro', **kwargs)
Returns Faust.norm(F, ord)` ornumpy.linalg.norm(F, ord)`` depending of F type.
Definition: __init__.py:3917
matfaust::factparams::ParamsHierarchicalNoResCons::ParamsHierarchicalNoResCons
function ParamsHierarchicalNoResCons(fact_constraints, stop_crit1, stop_crit2, varargin)
Constructor.
matfaust
The FAuST Matlab Wrapper
Definition: bsl.m:1
matfaust::factparams::ParamsHierarchical::ParamsHierarchical
function ParamsHierarchical(fact_constraints, res_constraints, stop_crit1, stop_crit2, varargin)
Constructor.
matfaust::fact
The matfaust factorization module.
Definition: butterfly.m:1
pyfaust.fact.hierarchical
def hierarchical(M, p, ret_lambda=False, ret_params=False, backend=2016, on_gpu=False)
Factorizes the matrix M using the hierarchical PALM4MSA algorithm according to the parameters set in ...
Definition: fact.py:1021
matfaust::factparams
The module for the parametrization of FAuST's algorithms (Palm4MSA and Hierarchical Factorization)