bartorch.moving_average

Contents

bartorch.moving_average#

bartorch.moving_average()#

Mean over each window of length consecutive elements along axis.

Only whole windows are taken: the axis shrinks from n to n - length + 1 and out[i] is the mean of input[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.shape with n - length + 1 along axis.

Return type:

torch.Tensor