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

  • 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 indices ks are merged into a single array of length K; if the trajectories of two target indices overlap, only trajectory value with the larger CostSegment window value remains.

  • merge_seg (bool, optional) – If True, all segments P are merged to a single target vector of length K; if the trajectories of two segments overlap, only trajectory value with the larger CostSegment window value remains.

  • fill_value (scalar, optional) – Default value of target output vector elements, when no trajectory is assigned.

Returns

output

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 sets

Examples