lmlib.statespace.cost.map_trajectories#
- lmlib.statespace.cost.map_trajectories(trajectories, ks, K, merge_ks=False, merge_seg=False, fill_value=nan)#
Maps trajectories at indices ks into a common target output vector of length K.
The parameter
trajectories
is commonly directly the output of one of the following methods:- Parameters
trajectories –
- list of shape=(XS) of tuples
(range, tuple)
, such tuples are the output of
CostSegment.trajectories()
.
- list of shape=(XS) of tuples
- list of shape=(XS) of tuples of shape=(P) of tuple
(range, tuple)
, such tuples are the output of
CompositeCost.trajectories()
.
- list of shape=(XS) of tuples of shape=(P) of tuple
ks (array_like of shape=(XS) of ints) – target indices in the target output vector, where to map the windows to
K (int) – Length of target vector
merge_ks (bool, optional) – If
True
, all trajectories from different target indicesks
are merged into a single array of lengthK
; if the trajectories of two target indices overlap, only trajectory value with the largerCostSegment
window value remains.merge_seg (bool, optional) – If
True
, all segments P are merged to a single target vector of lengthK
; if the trajectories of two segments overlap, only trajectory value with the largerCostSegment
window value remains.fill_value (scalar, optional) – Default value of target output vector elements, when no trajectory is assigned.
- Returns
output –
Dimension XS only exists, if
merge_ks
=False
.Dimension P only exists, if
merge_seg
=False
Dimension S only exists, if the parmeter
xs
ofCompositeCost.trajectories()
orCompositeCost.trajectories()
also provides dimension S (i.e., provides multiple signal set processing).
- Return type
ndarray
of shape=shape of ([XS,] [P,] K, L [,S]) of floats
XS : number of state vectors in a list
P : number of segments
K : number of samples
L : output order / number of signal channels
S : number of signal setsExamples