Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
341 views
in Technique[技术] by (71.8m points)

machine learning - What is "epoch" in keras.models.Model.fit?

What is "epoch" in keras.models.Model.fit? Is it one gradient update? If it is more than one gradient update, then what is defining an epoch?

Suppose I am feeding my own batches to fit. I would regard "epoch" as finishing to process entire training set (is this correct)? Then how to control keras for this way? Can I set batch_size equal to x and y size and epochs to 1?

question from:https://stackoverflow.com/questions/44907377/what-is-epoch-in-keras-models-model-fit

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here is how Keras documentation defines an epoch:

Epoch: an arbitrary cutoff, generally defined as "one pass over the entire dataset", used to separate training into distinct phases, which is useful for logging and periodic evaluation.

So, in other words, a number of epochs means how many times you go through your training set.

The model is updated each time a batch is processed, which means that it can be updated multiple times during one epoch. If batch_size is set equal to the length of x, then the model will be updated once per epoch.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...