Skip to main content

Early stopping for neural networks

Project description

Early Stopping

I'm too lazy to read the Tensorflow documentation, so I made this simple early stopper. After each training step, feed the object the testing loss result for that epoch and it will return a boolean that says whether or not to break the training loop.

Installation

Install through pip as shown:

pip install early-stopping

Example Usage

from early_stopping import EarlyStopping

early_stopper = EarlyStopping(
    depth=5,
    ignore=20,
    method='consistency'
)

# Your training loop
for epoch in range(EPOCHS):
    # Train step here
    # Test step here

    # Check if we should break the loop
    if early_stopper.check(testing_loss):
        print('BREAKING THE TRAINING LOOP')
        break

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

early-stopping-0.1.3.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

early_stopping-0.1.3-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page