- All Implemented Interfaces:
- Serializable, DataSetPreProcessor
public class LabelLastTimeStepPreProcessor
extends Object
implements DataSetPreProcessor
Used to extract the labels from a 3d format (shape: [minibatch, nOut, sequenceLength]) to a 2d format (shape: [minibatch, nOut])
where the values are the last time step of the labels.
For example, for 2 sequences:
[a, b, c, 0, 0]
[p, q, r, s, t]
(where a/b/p etc represet a vector of size numOutputs), and each row is the sequence for each
[1, 1, 1, 0, 0]
[1, 1, 1, 1, 1]
The new labels would be a rank 2 array of shape [minibatch, nOut] with values:
[c]
[t]
This preprocessor can be used for example to convert from "single non-masked time step" labels format (produced by
RecordReaderDataSetIterator, used in RnnOutputLayer) to 2d labels format (used in OutputLayer).
- Author:
- Alex Black
- See Also:
- Serialized Form