Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ffba7a80 authored by hhakim's avatar hhakim
Browse files

Update matfaust.factparams.* code/API doc and a few in pyfaust.factparams too.

parent 06d39154
Branches
No related tags found
No related merge requests found
......@@ -41,9 +41,13 @@ classdef (Abstract) ParamsFact
IDX_USE_CSR = 9
IDX_PACKING_RL = 10
% flags to control the optimization of the multiplication L'(LSR)R' in PALM4MSA
%> gradient product optimization is disabled
DISABLED_OPT = 0
%> gradient product optimization is handled internally
INTERNAL_OPT = 1
%> gradient product optimization is handled externally
EXTERNAL_OPT = 2
%> default is EXTERNAL_OPT
DEFAULT_OPT = 2
% the order of names matters and must respect the indices above
OPT_ARG_NAMES = {'is_update_way_R2L', 'init_lambda', 'step_size', 'constant_step_size', 'is_verbose', 'grad_calc_opt_mode', 'norm2_max_iter', 'norm2_threshold', 'packing_RL', 'use_csr' }
......
......@@ -32,7 +32,7 @@ classdef ParamsHierarchical < matfaust.factparams.ParamsFact
%> @param 'packing_RL', bool true (by default) to pre-compute R and L products (only available with 2020 backend of pyfaust.fact.hierarchical).
%> @param 'norm2_max_iter', int maximum number of iterations of power iteration algorithm (default to 100). Used for computing 2-norm.
%> @param 'norm2_threshold', real power iteration algorithm threshold (default to 1e-6). Used for computing 2-norm.
%> @param '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.
%> @param 'grad_calc_opt_mode', int the mode used for computing the PALM gradient. It can be one value among matfaust.factparams.ParamsFact.EXTERNAL_OPT, matfaust.factparams.ParamsFact.INTERNAL_OPT or matfaust.factparams.ParamsFact.DISABLED_OPT. This parameter is experimental, its value shouln't be changed.
% =========================================================
function p = ParamsHierarchical(fact_constraints, res_constraints, stop_crit1, stop_crit2, varargin)
import matfaust.factparams.*
......@@ -128,6 +128,13 @@ classdef ParamsHierarchical < matfaust.factparams.ParamsFact
end
end
% =========================================================
%> @brief This function handles the conversion of the structure instance to the mex format used by wrapper implementation.
%>
%> @note this function is not intended to be used by users.
%>
%> @retval The mex structure instance as expected by the mex wrapper used by matfaust.fact.hierarchical.
% =========================================================
function mex_params = to_mex_struct(this)
mex_constraints = cell(2, this.num_facts-1);
%mex_fact_constraints = cell(1, this.num_facts-1)
......
......@@ -11,6 +11,23 @@ classdef ParamsPalm4MSA < matfaust.factparams.ParamsFact
OPT_ARG_NAMES2 = { 'init_facts' }
end
methods
% =========================================================
%> @brief Constructor.
%>
%> @param constraints a ConstraintList object or a cell array of matfaust.proj.proj_gen objects to define the constraints of the factors.
%> @param stop_crit a matfaust.factparams.StoppingCriterion instance which defines the algorithm stopping criterion.
%> @param 'init_facts', cell array of matrices (optional) if defined, matfaust.fact.palm4msa will initialize the factors with init_facts (by default the first factor to be updated is initialized to zero and the others to identity. Note that the so called first factor can be the rightmost or the leftmost depending on the is_update_way_R2L argument).
%> @param 'is_update_way_R2L', bool (optional) if true matfaust.fact.palm4msa will update factors from the right to the left, otherwise it's done in reverse order.
%> @param 'init_lambda', real (optional) the scale scalar initial value (by default the value is one).
%> @param 'step_size', real (optional) the initial step of the PALM descent.
%> @param 'constant_step_size', real if true the step_size keeps constant along the algorithm iterations otherwise it is updated before every factor update.
%> @param 'is_verbose', boo (optional) True to enable the verbose mode.
%> parameter is experimental, its value shouldn't be changed.
%> @param 'norm2_max_iter', real (optional) maximum number of iterations of power iteration algorithm. Used for computing 2-norm.
%> @param 'norm2_threshold', real (optional) power iteration algorithm threshold (default to 1e-6). Used for computing 2-norm.
%> @param 'grad_calc_opt_mode', int (optional) the mode used for computing the PALM gradient. It can be one value among matfaust.factparams.ParamsFact.EXTERNAL_OPT, matfaust.factparams.ParamsFact.INTERNAL_OPT or matfaust.factparams.ParamsFact.DISABLED_OPT. This
%>
% =========================================================
function p = ParamsPalm4MSA(constraints, stop_crit, varargin)
import matfaust.factparams.*
if(isa(constraints, 'ConstraintList'))
......
......@@ -972,8 +972,8 @@ class ParamsPalm4MSA(ParamsFact):
factor update.
is_verbose: True to enable the verbose mode.
grad_calc_opt_mode: 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
It can be one value among pyfaust.factparams.ParamsFact.EXTERNAL_OPT,
pyfaust.factparams.ParamsFact.INTERNAL_OPT or pyfaust.factparams.ParamsFact.DISABLED_OPT. This
parameter is experimental, its value shouldn't be changed.
"""
if(not isinstance(constraints, list) and not
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment