iVAE.utils.moving_average

iVAE.utils.moving_average(a, window_size)[source]

Compute moving average with boundary handling.

This function computes a moving average while properly handling boundary conditions at the start and end of the array.

Parameters:
  • a (numpy.ndarray) – Input array to smooth.

  • window_size (int) – Size of the moving average window.

Returns:

Smoothed array of the same length as input.

Return type:

numpy.ndarray