shuffle in the model.fit of keras

China☆狼群 提交于 2020-02-02 02:22:53

问题


In the model.fit of keras, there is a shuffle parameter,

shuffle: Boolean (whether to shuffle the training data before each epoch) or str (for 'batch'). 'batch' is a special option for dealing with the limitations of HDF5 data; it shuffles in batch-sized chunks. Has no effect when steps_per_epoch is not  None.

Assume the training set is a list with 50000 elements, so the whole list will be randomly permuted before each epoch? Of if the batch size is 250, only the elements belonging to each batch get permuted? What should be the correct understanding?


回答1:


It will shuffle your entire dataset (x, y and sample_weight together) first and then make batches according to the batch_size argument you passed to fit.



来源:https://stackoverflow.com/questions/50184144/shuffle-in-the-model-fit-of-keras

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!