lmlib.statespace.cost.ConstrainMatrix#
- class lmlib.statespace.cost.ConstrainMatrix(cost)#
Bases:
object
Constrain Matrix Generator
Builder class to set up matrix H as a linear constraint for the squared error minimization
- Parameters
cost (CompositeCost, CostSegment) – CompositeCost or CostSegment
Methods
__init__
(cost)constrain
(indices, value)Add constrain
constrain_by_labels
(label_1, label_2, value)Add constrain by labels
digest
()Reruns a "snapshot" of the constraint matrix with the applied constrains
Prints the actual table of constraints to the console
Attributes
Two Sided Line Model Types.
- TSLM_TYPES = ('free', 'continuous', 'straight', 'horizontal', 'left horizontal', 'right horizontal', 'peak', 'step')#
Two Sided Line Model Types. see REF
- Type
tuple of string
- constrain(indices, value)#
Add constrain
I.e. Apply a dependency between two indices. See example below.
- Parameters
indices (array_like of shape(2,)) – indices to apply a dependency
value –
- Returns
s – self
- Return type
- constrain_by_labels(label_1, label_2, value)#
Add constrain by labels
I.e. Apply a dependency between two indices. See example below.
- Parameters
- Returns
s – self
- Return type
- digest()#
Reruns a “snapshot” of the constraint matrix with the applied constrains
- Returns
H – Constrain Matrix
- Return type
numpy.ndarray
of shape(N, M)
- print_table()#
Prints the actual table of constraints to the console