main content

feature extraction by using reconstruction ica -凯发k8网页登录

feature extraction by using reconstruction ica

description

mdl = rica(x,q) returns a reconstruction independent component analysis (rica) model object that contains the results from applying rica to the table or matrix of predictor data x containing p variables. q is the number of features to extract from x, therefore rica learns a p-by-q matrix of transformation weights. for undercomplete or overcomplete feature representations, q can be less than or greater than the number of predictor variables, respectively.

  • to access the learned transformation weights, use mdl.transformweights.

  • to transform x to the new set of features by using the learned transformation, pass mdl and x to .

example

mdl = rica(x,q,name,value) uses additional options specified by one or more name,value pair arguments. for example, you can standardize the predictor data or specify the value of the penalty coefficient in the reconstruction term of the objective function.

examples

create a reconstructionica object by using the rica function.

load the sampleimagepatches image patches.

data = load('sampleimagepatches');
size(data.x)
ans = 1×2
        5000         363

there are 5,000 image patches, each containing 363 features.

extract 100 features from the data.

rng default % for reproducibility
q = 100;
mdl = rica(data.x,q,'iterationlimit',100)
warning: solver lbfgs was not able to converge to a solution.
mdl = 
  reconstructionica
            modelparameters: [1x1 struct]
              numpredictors: 363
         numlearnedfeatures: 100
                         mu: []
                      sigma: []
                    fitinfo: [1x1 struct]
           transformweights: [363x100 double]
    initialtransformweights: []
    nongaussianityindicator: [100x1 double]
  properties, methods

rica issues a warning because it stopped due to reaching the iteration limit, instead of reaching a step-size limit or a gradient-size limit. you can still use the learned features in the returned object by calling the transform function.

input arguments

predictor data, specified as an n-by-p numeric matrix or table. rows correspond to individual observations and columns correspond to individual predictor variables. if x is a table, then all of its variables must be numeric vectors.

data types: single | double | table

number of features to extract from the predictor data, specified as a positive integer.

rica stores a p-by-q transform weight matrix in mdl.transformweights. therefore, setting very large values for q can result in greater memory consumption and increased computation time.

data types: single | double

name-value arguments

specify optional pairs of arguments as name1=value1,...,namen=valuen, where name is the argument name and value is the corresponding value. name-value arguments must appear after other arguments, but the order of the pairs does not matter.

before r2021a, use commas to separate each name and value, and enclose name in quotes.

example: mdl = rica(x,q,'iterationlimit',200,'standardize',true) runs rica with optimization iterations limited to 200 and standardized predictor data.

maximum number of iterations, specified as the comma-separated pair consisting of 'iterationlimit' and a positive integer.

example: 'iterationlimit',1e6

data types: single | double

verbosity level for monitoring algorithm convergence, specified as the comma-separated pair consisting of 'verbositylevel' and a value in this table.

valuedescription
0rica does not display convergence information at the command line.
positive integerrica displays convergence information at the command line.

convergence information

headingmeaning
fun valueobjective function value.
norm gradnorm of the gradient of the objective function.
norm stepnorm of the iterative step, meaning the distance between the previous point and the current point.
curvok means the weak wolfe condition is satisfied. this condition is a combination of sufficient decrease of the objective function and a curvature condition.
gammainner product of the step times the gradient difference, divided by the inner product of the gradient difference with itself. the gradient difference is the gradient at the current point minus the gradient at the previous point. gives diagnostic information on the objective function curvature.
alphastep direction multiplier, which differs from 1 when the algorithm performed a line search.
acceptyes means the algorithm found an acceptable step to take.

example: 'verbositylevel',1

data types: single | double

regularization coefficient value for the transform weight matrix, specified as the comma-separated pair consisting of 'lambda' and a positive numeric scalar. if you specify 0, then there is no regularization term in the objective function.

example: 'lambda',0.1

data types: single | double

flag to standardize the predictor data, specified as the comma-separated pair consisting of 'standardize' and true (1) or false (0).

if standardize is true, then:

  • rica centers and scales each column of the predictor data (x) by the column mean and standard deviation, respectively.

  • rica extracts new features by using the standardized predictor matrix, and stores the predictor variable means and standard deviations in properties mu and sigma of mdl.

example: 'standardize',true

data types: logical

contrast function, specified as 'logcosh', 'exp', or 'sqrt'. the contrast function is a smooth function that is similar to an absolute value function. the rica objective function contains a term

j=1q1ni=1ng(wjtx˜i),

where g represents the contrast function, the wj are the variables over which the optimization takes place, and the x˜i are data.

the three available contrast functions are:

  • 'logcosh'g=12log(cosh(2x))

  • 'exp'g=exp(x22)

  • 'sqrt'g=x2 108

example: 'contrastfcn','exp'

transformation weights that initialize optimization, specified as the comma-separated pair consisting of 'initialtransformweights' and a p-by-q numeric matrix. p must be the number of columns or variables in x and q is the value of q.

tip

you can continue optimizing a previously returned transform weight matrix by passing it as an initial value in another call to rica. the output model object mdl stores a learned transform weight matrix in the transformweights property.

example: 'initialtransformweights',mdl.transformweights

data types: single | double

non-gaussianity of sources, specified as a length-q vector of ±1.

  • nongaussianityindicator(k) = 1 means rica models the kth source as super-gaussian, with a sharp peak at 0.

  • nongaussianityindicator(k) = -1 means rica models the kth source as sub-gaussian.

data types: single | double

relative convergence tolerance on gradient norm, specified as the comma-separated pair consisting of 'gradienttolerance' and a positive numeric scalar. this gradient is the gradient of the objective function.

example: 'gradienttolerance',1e-4

data types: single | double

absolute convergence tolerance on the step size, specified as the comma-separated pair consisting of 'steptolerance' and a positive numeric scalar.

example: 'steptolerance',1e-4

data types: single | double

output arguments

learned reconstruction ica model, returned as a reconstructionica model object.

to access properties of mdl, use dot notation. for example:

  • to access the learned transform weights, use mdl.transformweights.

  • to access the structure of fitting information, use mdl.fitinfo.

algorithms

the rica function creates a linear transformation of input features to output features. the transformation is based on optimizing a nonlinear objective function that roughly balances statistical independence of the output features versus the ability to reconstruct the input data using the output features.

for details, see .

version history

introduced in r2017a

see also

| |

topics

    网站地图