Skip to content

Commit

Permalink
Use batch_num minimum in case the number of samples is less than batc…
Browse files Browse the repository at this point in the history
…h size
  • Loading branch information
louisPoulain committed Jun 27, 2024
1 parent 793bb32 commit 9c39515
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mlpp_lib/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def __init__(
self.shuffle = shuffle
self.block_size = block_size
self.num_samples = len(self.dataset.x)
self.num_batches = self.num_samples // batch_size
self.num_batches = self.num_samples // batch_size if batch_size <= self.num_samples else 1
self._indices = tf.range(self.num_samples)
self._seed = 0
self._reset()
Expand Down

0 comments on commit 9c39515

Please sign in to comment.