Optimizing Models - AI

Example Callback for stopping training early upon reaching high accuracy

# Haven't technically tested
class HighAccuracyStoppage(tf.keras.callbacks.Callback):
    def on_batch_end(self, epoch, logs={}):
        if(logs.get('accuracy')>0.99):
        print("\nReached 99% accuracy so cancelling training!")
        self.model.stop_training = True