title: How to use EarlyStopping to stop training when val_acc reaches a certain percentage
body: <p>I want to stop the training when it reaches a certain percentage, say 98%. I tried many ways and search on Google with no luck. What I do is using <code>EarlyStopping</code> like this:</p>
  
  <pre><code>es = EarlyStopping(monitor='val_acc', baseline=0.98, verbose=1)
  model.fit(tr_X, tr_y, epochs=1000, batch_size=1000, validation_data=(ts_X, ts_y), verbose=1, callbacks=[es])
  
  _, train_acc = model.evaluate(tr_X, tr_y, verbose=0)
  _, test_acc = model.evaluate(ts_X, ts_y, verbose=0)
  print('&gt;&gt; Train: %.3f, Test: %.3f' % (train_acc, test_acc))
  </code></pre>
  
  <p>This isn't correct. I would truly appreciate if someone can suggest a way to achieve this goal.</p>
  
  <p>Thank you,</p>