Skip to content

Commit

Permalink
Use last (incomplete) minibatch (keras-team#8310)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozabluda authored and fchollet committed Oct 31, 2017
1 parent 7d63ae6 commit d368dc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/cifar10_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D

import numpy as np
import os

batch_size = 32
Expand Down Expand Up @@ -100,7 +100,7 @@
# Fit the model on the batches generated by datagen.flow().
model.fit_generator(datagen.flow(x_train, y_train,
batch_size=batch_size),
steps_per_epoch=x_train.shape[0] // batch_size,
steps_per_epoch=int(np.ceil(x_train.shape[0] / float(batch_size))),
epochs=epochs,
validation_data=(x_test, y_test),
workers=4)
Expand Down
2 changes: 1 addition & 1 deletion examples/cifar10_resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@

# Fit the model on the batches generated by datagen.flow().
model.fit_generator(datagen.flow(x_train, y_train, batch_size=batch_size),
steps_per_epoch=x_train.shape[0] // batch_size,
steps_per_epoch=int(np.ceil(x_train.shape[0] / float(batch_size))),
validation_data=(x_test, y_test),
epochs=epochs, verbose=1, workers=4,
callbacks=callbacks)
Expand Down

0 comments on commit d368dc8

Please sign in to comment.