Skip to content

Commit 455a950

Browse files
fix: Actually use different batches during training (#21)
closes #20 Co-authored-by: Philipp <[email protected]>
1 parent 82b74c7 commit 455a950

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ void epoch(Network network, Dataset dataset, int batch_size, double learning_rat
310310
printf("Start epoch with %d batches (batch_size: %d)\n", batches, batch_size);
311311
for (int i = 0; i < batches; i++)
312312
{
313-
double loss = update_mini_batch(network, dataset.images, batch_size, learning_rate) / batch_size;
313+
double loss = update_mini_batch(network, dataset.images + i * batch_size, batch_size, learning_rate) / batch_size;
314314
printf("loss: %.4f\r", loss);
315315
}
316316
printf("\n");

0 commit comments

Comments
 (0)