Home | Trees | Indices | Help |
---|
|
object --+ | properties.Function --+ | properties.AtomicFunction --+ | object --+ | | | properties.Gradient --+ | object --+ | | | properties.Penalty --+ | object --+ | | | properties.Constraint --+ | QuadraticConstraint --+ | object --+ | | | properties.ProjectionOperator --+ | RGCCAConstraint
Represents the quadratic function f(x) = l * (x'(tau * I + ((1 - tau) / n) * X'X)x - c), where tau is a given regularisation constant. The constrained version has the form x'(tau * I + ((1 - tau) / n) * X'X)x <= c. Parameters ---------- l : Non-negative float. The Lagrange multiplier, or regularisation constant, of the function. c : Float. The limit of the constraint. The function is feasible if x'(tau * I + ((1 - tau) / n) * X'X)x <= c. The default value is c=0, i.e. the default is a regularisation formulation. tau : Non-negative float. The regularisation constant. X : Numpy array, n-by-p. The associated data matrix. The first penalty_start columns will be excluded. unbiased : Boolean. Whether the sample variance should be unbiased or not. Default is True, i.e. unbiased. penalty_start : Non-negative integer. The number of columns, variables etc., to be exempt from penalisation. Equivalently, the first index to be penalised. Default is 0, all columns are included.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Free any cached computations from previous use of this Function.
|
Function value.
|
Gradient of the function. From the interface "Gradient".
|
Feasibility of the constraint. From the interface "Constraint".
|
The projection operator corresponding to the function. From the interface "ProjectionOperator". Examples -------- >>> import parsimony.functions.penalties as penalties >>> import numpy as np >>> np.random.seed(42) >>> >>> X = np.random.randn(10, 10) >>> x = np.random.randn(10, 1) >>> L2 = penalties.RGCCAConstraint(c=1.0, tau=1.0, X=X, unbiased=True) >>> L2.f(x) 5.7906381220390024 >>> y = L2.proj(x) >>> abs(L2.f(y)) <= 2.0 * consts.FLOAT_EPSILON True >>> np.linalg.norm(y) 0.99999999999999989
|
Helper function to compute the function value. Note that beta must already be sliced! |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Apr 6 23:52:11 2015 | http://epydoc.sourceforge.net |