braindecode.preprocessing.exponential_moving_standardize

braindecode.preprocessing.exponential_moving_standardize(data, factor_new=0.001, init_block_size=None, eps=0.0001)

Perform exponential moving standardization.

Compute the exponental moving mean \(m_t\) at time t as \(m_t=\mathrm{factornew} \cdot mean(x_t) + (1 - \mathrm{factornew}) \cdot m_{t-1}\).

Then, compute exponential moving variance \(v_t\) at time t as \(v_t=\mathrm{factornew} \cdot (m_t - x_t)^2 + (1 - \mathrm{factornew}) \cdot v_{t-1}\).

Finally, standardize the data point \(x_t\) at time t as: \(x'_t=(x_t - m_t) / max(\sqrt{->v_t}, eps)\).

Parameters
data: np.ndarray (n_channels, n_times)
factor_new: float
init_block_size: int

Standardize data before to this index with regular standardization.

eps: float

Stabilizer for division by zero variance.

Returns
standardized: np.ndarray (n_channels, n_times)

Standardized data.

Examples using braindecode.preprocessing.exponential_moving_standardize