# Why is the sample size of stochastic gradient descent a power of 2?

I watched in the video lecture of cs224: Stanford CS224N: NLP with Deep Learning | Winter 2019 | Lecture 2 – Word Vectors and Word Senses.

They take the sample size of the window to be $$2^5 = 32$$ or $$2^6 = 64$$. Why is the sample size of stochastic gradient descent a power of 2? Why not we can take 42 or 53 as the sample window size?

Btw, how to identify best minimum window sample size?

• I'm not sure of a specific reason, but it could just be that using powers of 2 is computationally and memory efficient, as information in a computer is stored as binary, so in powers of 2. If you use a number such as 53, there's a bunch of under-utilised bytes. It's generally good practice to stick to powers of 2 for most computational things if you have the choice. – Recessive Mar 3 at 6:28