简体   繁体   中英

Is Keras Sequential fit the same as several train_on_batch calls?

Just confused as to the differences between keras.sequential train_on_batch and fit . Is the only difference that, with train_on_batch , you automatically pass over the data only once whereas with fit you specify this with the no. of epochs ?

If I do model.fit(x, y, epochs=5) is this the same as for i in range(5) model.train_on_batch(x, y) ?

If I do model.fit(x, y, epochs=5) is this the same as
for i in range(5) model.train_on_batch(x, y)?

Yes.

Your understanding is correct.

There are a few more bells and whistles to .fit() (we, can for example, artificially control the number of batches to consider an epoch rather than exhausting the whole dataset) but, fundamentally, you are correct.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM