ktrain  by amaiya

Python library for simplifying deep learning workflows

created 6 years ago
1,255 stars

Top 32.2% on sourcepulse

GitHubView on GitHub
Project Summary

ktrain is a Python library designed to simplify the application of deep learning and AI across various data types, including text, vision, graph, and tabular data. It targets both AI newcomers and experienced practitioners by providing a high-level API for building, training, and deploying models with minimal code. The library offers pre-canned models and streamlined workflows for common ML tasks, aiming to accelerate development and improve accessibility.

How It Works

ktrain acts as a lightweight wrapper around TensorFlow Keras, Hugging Face Transformers, and PyTorch, abstracting away much of the underlying complexity. It employs a "Learner" object that unifies model training, hyperparameter tuning (e.g., learning rate finders, 1cycle policy), and prediction APIs. This approach allows users to leverage state-of-the-art models with just a few lines of code, while still offering flexibility for customization and advanced techniques.

Quick Start & Requirements

Highlighted Details

  • Supports a wide range of tasks: text classification, NER, QA, summarization, translation, image classification, object detection, graph node classification, and tabular regression/classification.
  • Offers zero-shot learning, generative AI capabilities (local LLMs), and universal information extraction.
  • Includes built-in learning rate finders and schedulers (e.g., 1cycle policy).
  • Facilitates model export to ONNX and TensorFlow Lite.

Maintenance & Community

  • Creator: Arun S. Maiya.
  • The library is actively maintained, with recent releases and updates to modules (e.g., removal of generative_qa in v0.41.x).
  • Links to community resources are not explicitly provided in the README.

Licensing & Compatibility

  • The project is licensed under the Apache 2.0 License.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

  • As of TensorFlow >= 2.11, only legacy optimizers are supported; newer tf.keras.optimizers.Optimizer base class is not.
  • The library uses forked versions of eli5 and stellargraph to maintain TensorFlow 2 compatibility.
  • Pinning to older transformers versions for TensorFlow compatibility may require manual upgrades if newer transformers features are needed.
Health Check
Last commit

5 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.