I am asking this model fit( ) function.

fit(x=array_x, y=array_y, batch_size=32, epochs=10)

The question is straightforward:

Whether fit( ) will automatically shuffle the input dataset? (array_x, array_y in this case)

I ask this question because I find my fit( ) and fit_generator( ) has different outputs, with same input. My generator feeds inputs to fit_generator( ) in order. I guess the reason is about shuffle.


Yes, by default it does shuffle.

Here is the documentation: https://keras.io/models/model/#fit

The call signature, by default is then:

fit(x=None, y=None, batch_size=None, epochs=1, verbose=1, callbacks=None,
    validation_split=0.0, validation_data=None, shuffle=True, 
    lass_weight=None, sample_weight=None, initial_epoch=0,
    steps_per_epoch=None, validation_steps=None, validation_freq=1,
    ax_queue_size=10, workers=1, use_multiprocessing=False)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.