However, since the training is in batch mode, an online version of EMA is applied. To do so, the number of the nearest vectors in batch n and their sum z for the current batch t are added to the previous count of closest atoms vectors N (6) and their sum m (5), respectively. The codebook vector is updated in the following way (7):