-  3.41.0
pyfaust.factparams.ParamsHierarchical Class Reference

The parent class to set input parameters for the hierarchical factorization algorithm. More...

Public Member Functions

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)
 

Additional Inherited Members

- 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...
 
- 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
 

Detailed Description

The parent class to set input parameters for the hierarchical factorization algorithm.

The class' goal is to instantiate a fully defined set of parameters for the algorithm. But it exists simplified parameterizations for the same algorithm as child classes.

See also
init, ParamsHierarchicalWHT, ParamsHierarchicalRectMat pyfaust.fact.hierarchical

Constructor & Destructor Documentation

◆ __init__()

def pyfaust.factparams.ParamsHierarchical.__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.

Parameters
fact_constraints(ConstraintList or list[pyfaust.proj.proj_gen]) to define the constraints of the main factor at each level of the factorization hierarchy (the first one for the first factorization and so on).
res_constraints(ConstraintList or list[pyfaust.proj.proj_gen]) to define the constraints to apply to the residual factor at each level of the factorization hierarchy (the first one for the first factorization and so on).
stop_crit1(StoppingCriterion) defines the algorithm stopping criterion for the local optimization of the 2 terms of the last factorization (a main factor and a residual).
stop_crit2(StoppingCriterion) a pyfaust.factparams.StoppingCriterion instance which defines the algorithm stopping criterion for the global
optimization.
is_update_way_R2L(bool) if True pyfaust.fact.palm4msa (called for each optimization stage) will update factors from the right to the left, otherwise it's done in reverse order.
init_lambda(float) the scale scalar initial value for the global optimization (by default the value is one). It applies only to local optimization at each iteration (the global optimization lambda is updated consequently).
step_size(float) the initial step of the PALM descent for both local and global optimization stages.
constant_step_size(bool) if True the step_size keeps constant along the algorithm iterations otherwise it is updated before every factor update.
is_fact_side_left(bool) if True the leftmost factor is factorized, otherwise it's the rightmost.
is_verbose(bool) True to enable the verbose mode.
factor_format(str) 'dynamic' (by default), 'dense', or 'sparse'. If 'dense' or 'sparse' then all factors will be respectively numpy.ndarray or scipy.sparse.csr_matrix. If 'dynamic' is used then the algorithm determines the format of each factor automatically in order to decrease the memory footprint of the Faust. This option is available only on the 2020 backend pyfaust.fact.palm4msa, pyfaust.fact.hierarchical or pyfaust.fact.palm4msa_mhtp, pyfaust.fact.hierarchical_mhtp.
packing_RL(bool) True (by default) to pre-compute R and L products (only available with 2020 backend of pyfaust.fact.hierarchical).
no_normalization(bool) False (by default), if True it disables the normalization of prox output matrix in PALM4MSA algorithm. Note that this option is experimental (only available with 2020 backend of pyfaust.fact.hierarchical).
no_lambda(bool) False (by default), if True it disables the lambda scalar factor in the PALM4MSA algorithm which consists basically to set it always to one (it also lowers the algorithm cost).
norm2_max_iter(int) maximum number of iterations of power iteration algorithm. Used for computing 2-norm.
norm2_thresholdpower iteration algorithm threshold (default to 1e-6). Used for computing 2-norm.
grad_calc_opt_mode(int) the mode used for computing the PALM gradient. It can be one value among ParamsFact.EXTERNAL_OPT, ParamsFact.INTERNAL_OPT or ParamsFact.DISABLED_OPT. This parameter is experimental, its value shouln't be changed.

Member Function Documentation

◆ __repr__()

def pyfaust.factparams.ParamsHierarchical.__repr__ (   self)

Returns object representation.

Reimplemented from pyfaust.factparams.ParamsFact.

Reimplemented in pyfaust.factparams.ParamsHierarchicalDFT.

◆ are_constraints_consistent()

def pyfaust.factparams.ParamsHierarchical.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.

Returns
True if the constraints are consistent, raises a ValueError otherwise.

The documentation for this class was generated from the following file: