public class TimeSeriesUtils extends Object
Modifier and Type | Method and Description |
---|---|
static INDArray |
movingAverage(INDArray toAvg,
int n)
Calculate a moving average given the length
|
static Pair<INDArray,int[]> |
pullLastTimeSteps(INDArray pullFrom,
INDArray mask)
Extract out the last time steps (2d array from 3d array input) accounting for the mask layer, if present.
|
static Pair<INDArray,int[]> |
pullLastTimeSteps(INDArray pullFrom,
INDArray mask,
LayerWorkspaceMgr workspaceMgr,
ArrayType arrayType)
Extract out the last time steps (2d array from 3d array input) accounting for the mask layer, if present.
|
static INDArray |
reshape2dTo3d(INDArray in,
int miniBatchSize) |
static INDArray |
reshape2dTo3d(INDArray in,
int miniBatchSize,
LayerWorkspaceMgr workspaceMgr,
ArrayType arrayType) |
static INDArray |
reshape3dTo2d(INDArray in) |
static INDArray |
reshape3dTo2d(INDArray in,
LayerWorkspaceMgr workspaceMgr,
ArrayType arrayType) |
static INDArray |
reshapeCnnMaskToTimeSeriesMask(INDArray timeSeriesMaskAsCnnMask,
int minibatchSize)
Reshape CNN-style 4d mask array of shape [seqLength*minibatch,1,1,1] to time series mask [mb,seqLength]
This should match the assumptions (f order, etc) in RnnOutputLayer
|
static INDArray |
reshapePerOutputTimeSeriesMaskTo2d(INDArray perOutputTimeSeriesMask) |
static INDArray |
reshapePerOutputTimeSeriesMaskTo2d(INDArray perOutputTimeSeriesMask,
LayerWorkspaceMgr workspaceMgr,
ArrayType arrayType) |
static INDArray |
reshapeTimeSeriesMaskToCnn4dMask(INDArray timeSeriesMask,
LayerWorkspaceMgr workspaceMgr,
ArrayType arrayType)
Reshape time series mask arrays.
|
static INDArray |
reshapeTimeSeriesMaskToVector(INDArray timeSeriesMask)
Reshape time series mask arrays.
|
static INDArray |
reshapeTimeSeriesMaskToVector(INDArray timeSeriesMask,
LayerWorkspaceMgr workspaceMgr,
ArrayType arrayType)
Reshape time series mask arrays.
|
static INDArray |
reshapeVectorToTimeSeriesMask(INDArray timeSeriesMaskAsVector,
int minibatchSize)
Reshape time series mask arrays.
|
static INDArray |
reverseTimeSeries(INDArray in)
Reverse an input time series along the time dimension
|
static INDArray |
reverseTimeSeries(INDArray in,
LayerWorkspaceMgr workspaceMgr,
ArrayType arrayType)
Reverse an input time series along the time dimension
|
static INDArray |
reverseTimeSeriesMask(INDArray mask)
Reverse a (per time step) time series mask, with shape [minibatch, timeSeriesLength]
|
static INDArray |
reverseTimeSeriesMask(INDArray mask,
LayerWorkspaceMgr workspaceMgr,
ArrayType arrayType)
Reverse a (per time step) time series mask, with shape [minibatch, timeSeriesLength]
|
public static INDArray movingAverage(INDArray toAvg, int n)
toAvg
- the array to averagen
- the length of the moving windowpublic static INDArray reshapeTimeSeriesMaskToVector(INDArray timeSeriesMask)
timeSeriesMask
- Mask array to reshape to a column vectorpublic static INDArray reshapeTimeSeriesMaskToVector(INDArray timeSeriesMask, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType)
timeSeriesMask
- Mask array to reshape to a column vectorpublic static INDArray reshapeTimeSeriesMaskToCnn4dMask(INDArray timeSeriesMask, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType)
timeSeriesMask
- Mask array to reshape for CNN per-example maskingpublic static INDArray reshapeVectorToTimeSeriesMask(INDArray timeSeriesMaskAsVector, int minibatchSize)
timeSeriesMaskAsVector
- Mask array to reshape to a column vectorpublic static INDArray reshapeCnnMaskToTimeSeriesMask(INDArray timeSeriesMaskAsCnnMask, int minibatchSize)
timeSeriesMaskAsCnnMask
- Mask array to reshapepublic static INDArray reshapePerOutputTimeSeriesMaskTo2d(INDArray perOutputTimeSeriesMask)
public static INDArray reshapePerOutputTimeSeriesMaskTo2d(INDArray perOutputTimeSeriesMask, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType)
public static INDArray reshape3dTo2d(INDArray in, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType)
public static INDArray reshape2dTo3d(INDArray in, int miniBatchSize, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType)
public static INDArray reverseTimeSeries(INDArray in)
in
- Input activations to reverse, with shape [minibatch, size, timeSeriesLength]public static INDArray reverseTimeSeries(INDArray in, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType)
in
- Input activations to reverse, with shape [minibatch, size, timeSeriesLength]public static INDArray reverseTimeSeriesMask(INDArray mask)
mask
- Mask to reverse along time dimensionpublic static INDArray reverseTimeSeriesMask(INDArray mask, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType)
mask
- Mask to reverse along time dimensionpublic static Pair<INDArray,int[]> pullLastTimeSteps(INDArray pullFrom, INDArray mask)
pullFrom
- Input time series array (rank 3) to pull the last time steps frommask
- Mask array (rank 2). May be nullpublic static Pair<INDArray,int[]> pullLastTimeSteps(INDArray pullFrom, INDArray mask, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType)
pullFrom
- Input time series array (rank 3) to pull the last time steps frommask
- Mask array (rank 2). May be nullCopyright © 2019. All rights reserved.