https://amitprius.medium.com/early-stopping-callback-to-improve-neural-network-performance-with-python-a5437c427694