Is there an implementation of pocket algorithm in Keras?
Yes this is usually part of the early stopping algorithm, where you supply a cross-validation data set, and a limit on number of epochs since best result so far.

In Keras, you can use an instance of the EarlyStopping class, choosing the metric that you want the best model for, and setting the patience parameter to limit the number of epochs to test after any best so far result. The instance is supplied to the fit method as a callback.

See http://parneetk.github.io/blog/neural-networks-in-keras/ for an example (last section)