keras-transformer  by kpot

Keras library for building Transformer models, enabling BERT and GPT

Created 7 years ago
540 stars

Top 58.9% on SourcePulse

GitHubView on GitHub
Project Summary

This library provides Keras layers for building Universal Transformer models, targeting researchers and practitioners in NLP. It offers a flexible, modular approach to constructing Transformer architectures, enabling experimentation with models like BERT and GPT.

How It Works

The library implements core Transformer components as standalone Keras layers, including positional encoding, attention masking, and memory-compressed attention. This modular design allows users to assemble custom Transformer architectures by composing these layers, facilitating experimentation with variations like Adaptive Computation Time (ACT) and enabling direct replacement or rearrangement of components.

Quick Start & Requirements

  • Install via pip install . after cloning the repository.
  • Requires Python >= 3.6.
  • Example usage requires pip install -r example/requirements.txt and a Keras backend like TensorFlow (pip install tensorflow).
  • Examples are available for BERT and GPT language modeling on WikiText-2.

Highlighted Details

  • Supports Universal Transformers, BERT, and GPT architectures.
  • Includes memory-compressed attention and Adaptive Computation Time (ACT).
  • Modular Keras layers allow for custom model construction.
  • Demonstrates language modeling on WikiText-2 with perplexity metrics.

Maintenance & Community

No specific information on maintainers, community channels, or roadmap is provided in the README.

Licensing & Compatibility

The README does not explicitly state a license.

Limitations & Caveats

The provided examples are demonstrations and not rigorous evaluations. Training BERT models requires significant time and computational resources.

Health Check
Last Commit

5 years ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
2 stars in the last 30 days

Explore Similar Projects

Starred by Stas Bekman Stas Bekman(Author of "Machine Learning Engineering Open Book"; Research Engineer at Snowflake) and Thomas Wolf Thomas Wolf(Cofounder of Hugging Face).

transformer by sannykim

0%
546
Resource list for studying Transformers
Created 6 years ago
Updated 1 year ago
Starred by Elvis Saravia Elvis Saravia(Founder of DAIR.AI) and Stas Bekman Stas Bekman(Author of "Machine Learning Engineering Open Book"; Research Engineer at Snowflake).

awesome-transformer-nlp by cedrickchee

0%
1k
Curated list of NLP resources for Transformer networks
Created 6 years ago
Updated 10 months ago
Feedback? Help us improve.