bartorch.moving_average#
- bartorch.moving_average()#
Mean over each window of
lengthconsecutive elements alongaxis.Only whole windows are taken: the axis shrinks from
nton - length + 1andout[i]is the mean ofinput[i:i + length].- Parameters:
input (torch.Tensor) – Array to filter.
axis (int) – Axis to filter along.
length (int) – Window length, between one and the axis length.
- Returns:
input.shapewithn - length + 1alongaxis.- Return type:
torch.Tensor