title: Determining number of epochs for model fitting in Keras
body: <p>I'm trying to automatically determine when a Keras autoencoder converges. For example, look at this <a href="https://blog.keras.io/building-autoencoders-in-keras.html" rel="nofollow noreferrer">link</a> under "Let's build the simplest autoencoder possible." The number of epochs is hardcoded at 50 (when the loss value converges). However, how would you code this using Keras if you didn't know the number was 50? Would you just keep calling <code>fit()</code>? </p>