Skip to main content

Keras Utils

This package provides utilities for Keras, such as modified callbacks, genereators, etc.

Installation

To install the package from the PyPi repository you can execute the following command:

pip install keras-utils

Usage

The usage of the package is simple:

import keras
import keras_utils

# build your model
model = get_model(input_shape, num_classes=num_classes, reserve_layers=reserve_layers)

# build your train-set & validation-set generators
train_generator = ImageDataGenerator().flow_from_directory(
        train_images_path,
        target_size=target_size,
        batch_size=batch_size,
        color_mode='rgb',
        class_mode='categorical',
        seed=seed,
        shuffle=True
)

valid_generator = ImageDataGenerator().flow_from_directory(
        valid_images_path,
        target_size=target_size,
        batch_size=1,
        color_mode='rgb',
        class_mode='categorical',
        shuffle=False
)

# create a validation-callback which tests the validation-set every 10 epocks
valid_callback = ValidateCallback(10, valid_generator, model)

# create a save-callback which saves the model every 20 epochs under the name "model_name"
save_callback = SaveCallback(20, 'model_name.model', model)

# train your model
model.fit_generator(generator=train_generator,
                    epochs=epochs,
                    verbose=1,
                    workers=8,
                    callbacks=[valid_callback, save_callback])

Metadata

Release files for keras-utils 1.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keras-utils 1.0.13
File Size Uploaded Provenance Actions
keras-utils-1.0.13.tar.gz 2.4 kB Without provenance Details for keras-utils-1.0.13.tar.gz

Release files / keras-utils-1.0.13.tar.gz

Download URL keras-utils-1.0.13.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2e0269412869b38a321356421bfc12f5787e37752601dd2c000b6d87d86a5a7a
BLAKE2b-256 checksum
How to use checksums
31a28be2aee1c8cd388e83d447556c2c84a396944c8bad93d710c5e757f8e98e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Security for keras-utils 1.0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page