-1
mini_batch_X = shuffled_X[:, k * mini_batch_size:(k + 1) * mini_batch_size]

What is the semantics of the above line? what does the first colon mean?

desertnaut
  • 57,590
  • 26
  • 140
  • 166

1 Answers1

0

Colon in a slicing operation will generate slice(None, None, None), in numpy it means take all indices for this dimension.

A slice is start:end:step, usually step is omitted writing only start:end, but you can also omit start :end that will slice from beginning, or start: that will end at the last index.

Bob
  • 13,867
  • 1
  • 5
  • 27